From 863475661b333e07461ccec7963ba131690c41fb Mon Sep 17 00:00:00 2001 From: RobThree Date: Tue, 27 Oct 2020 10:17:17 +0100 Subject: [PATCH] ISignaler now implements IDisposable instead of the timers --- .../Content/VersionHistory/VersionHistory.aml | 15 +++++++--- .../Content/VersionHistory/v1.0.1.0.aml | 30 +++++++++++++++++++ ITimer.Documentation/ContentLayout.content | 7 ++++- .../ITimer.Documentation.shfbproj | 1 + ITimer/ISignaler.cs | 2 +- ITimer/ITimer.csproj | 4 +-- ITimer/SystemTimer.cs | 2 +- ITimer/TestTimer.cs | 22 ++++++++++++++ ITimer/ThreadingTimer.cs | 2 +- 9 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 ITimer.Documentation/Content/VersionHistory/v1.0.1.0.aml diff --git a/ITimer.Documentation/Content/VersionHistory/VersionHistory.aml b/ITimer.Documentation/Content/VersionHistory/VersionHistory.aml index 2ccf1b9..f3152d4 100644 --- a/ITimer.Documentation/Content/VersionHistory/VersionHistory.aml +++ b/ITimer.Documentation/Content/VersionHistory/VersionHistory.aml @@ -11,10 +11,17 @@ Select a version below to see a description of its changes. - - - - + + + + + + + + + + + diff --git a/ITimer.Documentation/Content/VersionHistory/v1.0.1.0.aml b/ITimer.Documentation/Content/VersionHistory/v1.0.1.0.aml new file mode 100644 index 0000000..3297926 --- /dev/null +++ b/ITimer.Documentation/Content/VersionHistory/v1.0.1.0.aml @@ -0,0 +1,30 @@ + + + + + + Version 1.0.1 was released on 2020-10-27. + + + +
+ Changes in This Release + + + + + + T:ITimer.ISignaler now implements T:System.IDisposable instead of the timers. + + + + + +
+ + + + + +
+
diff --git a/ITimer.Documentation/ContentLayout.content b/ITimer.Documentation/ContentLayout.content index 6a14b57..1fdcabf 100644 --- a/ITimer.Documentation/ContentLayout.content +++ b/ITimer.Documentation/ContentLayout.content @@ -1,6 +1,6 @@  - + @@ -14,5 +14,10 @@ + + + + + \ No newline at end of file diff --git a/ITimer.Documentation/ITimer.Documentation.shfbproj b/ITimer.Documentation/ITimer.Documentation.shfbproj index 97d1fe7..46caba6 100644 --- a/ITimer.Documentation/ITimer.Documentation.shfbproj +++ b/ITimer.Documentation/ITimer.Documentation.shfbproj @@ -81,6 +81,7 @@ + diff --git a/ITimer/ISignaler.cs b/ITimer/ISignaler.cs index 6513c27..a58bf43 100644 --- a/ITimer/ISignaler.cs +++ b/ITimer/ISignaler.cs @@ -12,7 +12,7 @@ namespace ITimer /// and as interface name. If you have any better suggestions, please let us know and /// we'll consider it for the next major version. /// - public interface ISignaler + public interface ISignaler : IDisposable { /// /// Occurs when the interval elapses. diff --git a/ITimer/ITimer.csproj b/ITimer/ITimer.csproj index d15f72e..b876ff1 100644 --- a/ITimer/ITimer.csproj +++ b/ITimer/ITimer.csproj @@ -11,11 +11,11 @@ https://github.com/RobThree/ITimer Git timer clock - 1.0.0 + 1.0.1 Provides a testable abstraction and alternative to System.Threading.Timer and System.Timers.Timer logo.png Debug;Release;ReleaseWithDocumentation - Initial release + Move IDisposable from timers to interface diff --git a/ITimer/SystemTimer.cs b/ITimer/SystemTimer.cs index ab35dd0..48610c0 100644 --- a/ITimer/SystemTimer.cs +++ b/ITimer/SystemTimer.cs @@ -7,7 +7,7 @@ namespace ITimer /// /// Provides a wrapper for the implementing the interface. /// - public class SystemTimer : BaseTimer, ISignaler, IDisposable + public class SystemTimer : BaseTimer, ISignaler { private bool _disposed; private readonly Timer _timer; diff --git a/ITimer/TestTimer.cs b/ITimer/TestTimer.cs index 61f41cd..32d2178 100644 --- a/ITimer/TestTimer.cs +++ b/ITimer/TestTimer.cs @@ -168,6 +168,28 @@ public void Reset() _startcount = 0; _stopcount = 0; } + + #region IDisposable + /// + /// Releases all resources used by the current . + /// + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + /// + protected virtual void Dispose(bool disposing) + { + //NOP + } + + /// + /// Releases all resources used by the current . + /// + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + #endregion } /// diff --git a/ITimer/ThreadingTimer.cs b/ITimer/ThreadingTimer.cs index c9711fc..46c84b7 100644 --- a/ITimer/ThreadingTimer.cs +++ b/ITimer/ThreadingTimer.cs @@ -6,7 +6,7 @@ namespace ITimer /// /// Provides a wrapper for the implementing the interface. /// - public class ThreadingTimer : BaseTimer, ISignaler, IDisposable + public class ThreadingTimer : BaseTimer, ISignaler { private bool _disposed; private readonly Timer _timer;