Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/Microsoft.Private.PackageBaseline/packageIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@
"AssemblyVersionInPackageVersion": {
"4.0.0.0": "4.0.0",
"4.1.0.0": "4.1.0",
"4.1.1.0": "4.3.0"
"4.2.0.0": "4.3.0"
}
},
"System.Console": {
Expand Down
2 changes: 1 addition & 1 deletion src/System.ComponentModel.TypeConverter/dir.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</PropertyGroup>
</Project>

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<SupportedFramework>net45;netcore45;wp8;wpa81</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\ref\System.ComponentModel.TypeConverter.csproj">
<SupportedFramework>net462;netcoreapp1.0;$(AllXamarinFrameworks)</SupportedFramework>
<SupportedFramework>net463;netcoreapp1.1;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.ComponentModel.TypeConverter.builds" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

// Stub to unblock explosing System.Timers

namespace System.ComponentModel
{
public partial interface ISynchronizeInvoke
{
IAsyncResult BeginInvoke(Delegate method, object[] args);
object EndInvoke(IAsyncResult result);
object Invoke(Delegate method, object[] args);
bool InvokeRequired { get; }
}

public partial interface ISupportInitialize
{
void BeginInit();
void EndInit();
}

public partial class Component : IDisposable
{
public Component() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~Component() { }
protected virtual object GetService(Type service) { return default(object); }
public override string ToString() { return default(string); }
protected virtual bool CanRaiseEvents { get { return default(bool); } }
protected bool DesignMode { get { return default(bool); } }
public virtual ISite Site { get { return default(ISite); } set { } }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------


namespace System.ComponentModel
{
public partial class ArrayConverter : System.ComponentModel.CollectionConverter
Expand Down Expand Up @@ -648,6 +647,41 @@ public UInt64Converter() { }
}
}

namespace System.Timers
{
public partial class Timer : System.ComponentModel.Component, System.ComponentModel.ISupportInitialize
{
public Timer() { }
public Timer(double interval) { }
public void BeginInit() { }
public void Close() { }
protected override void Dispose(bool disposing) { }
public void EndInit() { }
public void Start() { }
public void Stop() { }
public bool AutoReset { get { return default(bool); } set { } }
public bool Enabled { get { return default(bool); } set { } }
public double Interval { get { return default(double); } set { } }
public override System.ComponentModel.ISite Site { get { return default(System.ComponentModel.ISite); } set { } }
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject { get { return default(System.ComponentModel.ISynchronizeInvoke); } set { } }
public event ElapsedEventHandler Elapsed { add { } remove { } }
}

public partial class TimersDescriptionAttribute : System.ComponentModel.DescriptionAttribute
{
public TimersDescriptionAttribute(string description) { }
public override string Description { get { return default(string); } }
}

public delegate void ElapsedEventHandler(object sender, ElapsedEventArgs e);

public partial class ElapsedEventArgs : EventArgs
{
internal ElapsedEventArgs(long fileTime) { }
public DateTime SignalTime { get { return default(DateTime); } }
}
}

namespace System
{
public partial class UriTypeConverter : System.ComponentModel.TypeConverter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<NuGetTargetMoniker>.NETStandard,Version=v1.5</NuGetTargetMoniker>
<NuGetTargetMoniker>.NETStandard,Version=v1.7</NuGetTargetMoniker>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.ComponentModel.TypeConverter.cs" />
<Compile Include="System.ComponentModel.Manual.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
Expand Down
4 changes: 2 additions & 2 deletions src/System.ComponentModel.TypeConverter/ref/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"System.Runtime": "4.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably update these package versions to use the latest prerelease instead so that we are all compatible and have the right dependencies across ns1.7

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address in a separate PR>

},
"frameworks": {
"netstandard1.5": {
"netstandard1.7": {
"imports": [
"dotnet5.1"
"dotnet5.8"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really necessary still?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no.

]
}
}
Expand Down
21 changes: 21 additions & 0 deletions src/System.ComponentModel.TypeConverter/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,25 @@
<data name="TypeDescriptorSameAssociation" xml:space="preserve">
<value>Cannot create an association when the primary and secondary objects are the same.</value>
</data>
<data name="InvalidParameter" xml:space="preserve">
<value>Invalid value '{1}' for parameter '{0}'.</value>
</data>
<data name="TimerAutoReset" xml:space="preserve">
<value>Indicates whether the timer will be restarted when it is enabled.</value>
</data>
<data name="TimerEnabled" xml:space="preserve">
<value>Indicates whether the timer is enabled to fire events at a defined interval.</value>
</data>
<data name="TimerInterval" xml:space="preserve">
<value>The number of milliseconds between timer events.</value>
</data>
<data name="TimerIntervalElapsed" xml:space="preserve">
<value>Occurs when the Interval has elapsed.</value>
</data>
<data name="TimerInvalidInterval" xml:space="preserve">
<value>'{0}' is not a valid value for 'Interval'. 'Interval' must be greater than {1}.</value>
</data>
<data name="TimerSynchronizingObject" xml:space="preserve">
<value>The object used to marshal the event handler calls issued when an interval has elapsed.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
<ItemGroup>
<Project Include="System.ComponentModel.TypeConverter.csproj" />
<Project Include="System.ComponentModel.TypeConverter.csproj">
<TargetGroup>net45</TargetGroup>
</Project>
<Project Include="System.ComponentModel.TypeConverter.csproj">
<TargetGroup>net462</TargetGroup>
</Project>
<Project Include="System.ComponentModel.TypeConverter.csproj">
<TargetGroup>netstandard1.0</TargetGroup>
<TargetGroup>net463</TargetGroup>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
<ProjectGuid>{AF3EBF3B-526A-4B51-9F3D-62B0113CD01F}</ProjectGuid>
<RootNamespace>System.ComponentModel.TypeConverter</RootNamespace>
<AssemblyName>System.ComponentModel.TypeConverter</AssemblyName>
<AssemblyVersion Condition="'$(TargetGroup)' == 'netstandard1.0' OR '$(TargetGroup)'=='net45'">4.0.0.0</AssemblyVersion>
<ContractProject Condition="'$(TargetGroup)' == 'netstandard1.0' OR '$(TargetGroup)'=='net45'">..\ref\4.0\$(AssemblyName).depproj</ContractProject>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='net45' OR '$(TargetGroup)'=='net462'">true</IsPartialFacadeAssembly>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.5</NuGetTargetMoniker>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='net463'">true</IsPartialFacadeAssembly>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.7</NuGetTargetMoniker>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
Expand Down Expand Up @@ -55,6 +53,11 @@
<Compile Include="System\ComponentModel\UriTypeConverter.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'==''">
<Compile Include="System\Timers\ElapsedEventArgs.cs" />
<Compile Include="System\Timers\ElapsedEventHandler.cs" />
<Compile Include="System\Timers\System.ComponentModel.cs" />
<Compile Include="System\Timers\Timer.cs" />
<Compile Include="System\Timers\TimersDescriptionAttribute.cs" />
<Compile Include="System\ComponentModel\AttributeCollection.cs" />
<Compile Include="System\ComponentModel\AttributeProviderAttribute.cs" />
<Compile Include="System\ComponentModel\CancelEventHandler.cs" />
Expand Down Expand Up @@ -98,7 +101,7 @@
<ItemGroup Condition="'$(TargetGroup)'==''">
<EmbeddedResource Include="$(MsBuildThisFileDirectory)Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='net45' OR '$(TargetGroup)'=='net462'">
<ItemGroup Condition="'$(TargetGroup)'=='net463'">
<TargetingPackReference Include="mscorlib" />
<TargetingPackReference Include="System" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Timers
{
public class ElapsedEventArgs : EventArgs
{
private readonly DateTime _signalTime;

internal ElapsedEventArgs(long fileTime)
{
_signalTime = DateTime.FromFileTime(fileTime);
}

public DateTime SignalTime
{
get
{
return _signalTime;
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Timers
{
public delegate void ElapsedEventHandler(object sender, ElapsedEventArgs e);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

// Stub to unblock explosing System.Timers Issue dotnet/corefx#11774

namespace System.ComponentModel.Design
{
public partial interface IDesignerHost
{
IComponent RootComponent { get; }
}
}

namespace System.ComponentModel
{
public partial interface ISynchronizeInvoke
{
IAsyncResult BeginInvoke(Delegate method, object[] args);
object EndInvoke(IAsyncResult result);
object Invoke(Delegate method, object[] args);
bool InvokeRequired { get; }
}

public partial interface ISupportInitialize
{
void BeginInit();
void EndInit();
}

public partial class Component : IDisposable
{
public Component() { }
public void Dispose() { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dispose should invoke Dispose(true) and suppress finalization.

protected virtual void Dispose(bool disposing) { }
~Component() { }
protected virtual object GetService(Type service) { return default(object); }
public override string ToString() { return default(string); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToString() should return base.ToString().

protected virtual bool CanRaiseEvents { get { return default(bool); } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Desktop returns true from this. Are we explicitly deciding to return false?

Copy link
Contributor Author

@Priya91 Priya91 Sep 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is not completely ported, i am just using it as a stub to get System.Timers unblocked. @AlexGhiondea is going to do the bulk porting of System.ComponentModel into a different assembly. Once his work is complete, we'll remove this.. Same for all concers in System.ComponentModel.cs, will add a comment and tracking bug.

protected bool DesignMode { get { return default(bool); } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I realize it's the same thing, but this should probably be return false;

public virtual ISite Site { get { return default(ISite); } set { } }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't Component have a Disposed event?

}
}
Loading