Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
ISignaler now implements IDisposable instead of the timers
Browse files Browse the repository at this point in the history
  • Loading branch information
RobThree committed Oct 27, 2020
1 parent baed93a commit 8634756
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 10 deletions.
15 changes: 11 additions & 4 deletions ITimer.Documentation/Content/VersionHistory/VersionHistory.aml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@
<para>Select a version below to see a description of its changes.</para>

<list class="bullet">
<listItem>
<para><link xlink:href="9340bd14-6fb5-4204-8d7f-82cf089eeef6" /></para>
</listItem>
</list>
<listItem>
<para>
<link xlink:href="9340bd14-6fb5-4204-8d7f-82cf089eeef6" />
</para>
</listItem>
<listItem>
<para>
<link xlink:href="0ca6b009-fe8b-4dcf-b4a4-8d5e4beff7c1" />
</para>
</listItem>
</list>

</content>
</section>
Expand Down
30 changes: 30 additions & 0 deletions ITimer.Documentation/Content/VersionHistory/v1.0.1.0.aml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<topic id="0ca6b009-fe8b-4dcf-b4a4-8d5e4beff7c1" revisionNumber="1">
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<para>
Version 1.0.1 was released on 2020-10-27.
</para>
</introduction>

<section>
<title>Changes in This Release</title>
<content>

<list class="bullet">
<listItem>
<para>
<codeEntityReference>T:ITimer.ISignaler</codeEntityReference> now implements <codeEntityReference>T:System.IDisposable</codeEntityReference> instead of the timers.</para>
</listItem>

</list>

</content>
</section>

<relatedTopics>
<link xlink:href="09c91a5b-a188-4372-911c-3a41d44605e2" />
</relatedTopics>

</developerConceptualDocument>
</topic>
7 changes: 6 additions & 1 deletion ITimer.Documentation/ContentLayout.content
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Topics>
<Topic id="f040de3f-48bf-4692-bd45-e7ae3115b34d" visible="True" isDefault="true" isSelected="true" title="Welcome to the ITimer project">
<Topic id="f040de3f-48bf-4692-bd45-e7ae3115b34d" visible="True" isDefault="true" title="Welcome to the ITimer project">
<HelpKeywords>
<HelpKeyword index="K" term="Welcome" />
</HelpKeywords>
Expand All @@ -14,5 +14,10 @@
<HelpKeyword index="K" term="version, 1.0.0.0" />
</HelpKeywords>
</Topic>
<Topic id="0ca6b009-fe8b-4dcf-b4a4-8d5e4beff7c1" visible="True" isSelected="true" title="Version 1.0.1.0">
<HelpKeywords>
<HelpKeyword index="K" term="version, 1.0.1.0" />
</HelpKeywords>
</Topic>
</Topic>
</Topics>
1 change: 1 addition & 0 deletions ITimer.Documentation/ITimer.Documentation.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Content\VersionHistory\v1.0.0.0.aml" />
<None Include="Content\VersionHistory\v1.0.1.0.aml" />
<None Include="Content\VersionHistory\VersionHistory.aml" />
<None Include="Content\Welcome.aml" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ITimer/ISignaler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace ITimer
/// and <see cref="ISignaler" /> as interface name. If you have any better suggestions, please let us know and
/// we'll consider it for the next major version.
/// </remarks>
public interface ISignaler
public interface ISignaler : IDisposable
{
/// <summary>
/// Occurs when the interval elapses.
Expand Down
4 changes: 2 additions & 2 deletions ITimer/ITimer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<RepositoryUrl>https://github.com/RobThree/ITimer</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>timer clock</PackageTags>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Description>Provides a testable abstraction and alternative to System.Threading.Timer and System.Timers.Timer</Description>
<PackageIcon>logo.png</PackageIcon>
<Configurations>Debug;Release;ReleaseWithDocumentation</Configurations>
<PackageReleaseNotes>Initial release</PackageReleaseNotes>
<PackageReleaseNotes>Move IDisposable from timers to interface</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDocumentation|AnyCPU'">
Expand Down
2 changes: 1 addition & 1 deletion ITimer/SystemTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace ITimer
/// <summary>
/// Provides a wrapper for the <see cref="System.Timers.Timer" /> implementing the <see cref="ISignaler" /> interface.
/// </summary>
public class SystemTimer : BaseTimer, ISignaler, IDisposable
public class SystemTimer : BaseTimer, ISignaler
{
private bool _disposed;
private readonly Timer _timer;
Expand Down
22 changes: 22 additions & 0 deletions ITimer/TestTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,28 @@ public void Reset()
_startcount = 0;
_stopcount = 0;
}

#region IDisposable
/// <summary>
/// Releases all resources used by the current <see cref="ThreadingTimer" />.
/// </summary>
/// <param name="disposing">
/// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
/// </param>
protected virtual void Dispose(bool disposing)
{
//NOP
}

/// <summary>
/// Releases all resources used by the current <see cref="ThreadingTimer" />.
/// </summary>
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
#endregion
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ITimer/ThreadingTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ITimer
/// <summary>
/// Provides a wrapper for the <see cref="System.Threading.Timer" /> implementing the <see cref="ISignaler" /> interface.
/// </summary>
public class ThreadingTimer : BaseTimer, ISignaler, IDisposable
public class ThreadingTimer : BaseTimer, ISignaler
{
private bool _disposed;
private readonly Timer _timer;
Expand Down

0 comments on commit 8634756

Please sign in to comment.