-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Port System.Timers.Timer to netstandard1.7 #11760
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
|---|---|---|
| @@ -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 |
|---|---|---|
|
|
@@ -8,9 +8,9 @@ | |
| "System.Runtime": "4.0.0" | ||
| }, | ||
| "frameworks": { | ||
| "netstandard1.5": { | ||
| "netstandard1.7": { | ||
| "imports": [ | ||
| "dotnet5.1" | ||
| "dotnet5.8" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really necessary still?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no. |
||
| ] | ||
| } | ||
| } | ||
|
|
||
| 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() { } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); } } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Desktop returns true from this. Are we explicitly deciding to return false?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); } } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| public virtual ISite Site { get { return default(ISite); } set { } } | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't Component have a Disposed event? |
||
| } | ||
| } | ||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>