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

Commit 8634756

Browse files
committed
ISignaler now implements IDisposable instead of the timers
1 parent baed93a commit 8634756

File tree

9 files changed

+75
-10
lines changed

9 files changed

+75
-10
lines changed

ITimer.Documentation/Content/VersionHistory/VersionHistory.aml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@
1111
<para>Select a version below to see a description of its changes.</para>
1212

1313
<list class="bullet">
14-
<listItem>
15-
<para><link xlink:href="9340bd14-6fb5-4204-8d7f-82cf089eeef6" /></para>
16-
</listItem>
17-
</list>
14+
<listItem>
15+
<para>
16+
<link xlink:href="9340bd14-6fb5-4204-8d7f-82cf089eeef6" />
17+
</para>
18+
</listItem>
19+
<listItem>
20+
<para>
21+
<link xlink:href="0ca6b009-fe8b-4dcf-b4a4-8d5e4beff7c1" />
22+
</para>
23+
</listItem>
24+
</list>
1825

1926
</content>
2027
</section>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<topic id="0ca6b009-fe8b-4dcf-b4a4-8d5e4beff7c1" revisionNumber="1">
3+
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
4+
<introduction>
5+
<para>
6+
Version 1.0.1 was released on 2020-10-27.
7+
</para>
8+
</introduction>
9+
10+
<section>
11+
<title>Changes in This Release</title>
12+
<content>
13+
14+
<list class="bullet">
15+
<listItem>
16+
<para>
17+
<codeEntityReference>T:ITimer.ISignaler</codeEntityReference> now implements <codeEntityReference>T:System.IDisposable</codeEntityReference> instead of the timers.</para>
18+
</listItem>
19+
20+
</list>
21+
22+
</content>
23+
</section>
24+
25+
<relatedTopics>
26+
<link xlink:href="09c91a5b-a188-4372-911c-3a41d44605e2" />
27+
</relatedTopics>
28+
29+
</developerConceptualDocument>
30+
</topic>

ITimer.Documentation/ContentLayout.content

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Topics>
3-
<Topic id="f040de3f-48bf-4692-bd45-e7ae3115b34d" visible="True" isDefault="true" isSelected="true" title="Welcome to the ITimer project">
3+
<Topic id="f040de3f-48bf-4692-bd45-e7ae3115b34d" visible="True" isDefault="true" title="Welcome to the ITimer project">
44
<HelpKeywords>
55
<HelpKeyword index="K" term="Welcome" />
66
</HelpKeywords>
@@ -14,5 +14,10 @@
1414
<HelpKeyword index="K" term="version, 1.0.0.0" />
1515
</HelpKeywords>
1616
</Topic>
17+
<Topic id="0ca6b009-fe8b-4dcf-b4a4-8d5e4beff7c1" visible="True" isSelected="true" title="Version 1.0.1.0">
18+
<HelpKeywords>
19+
<HelpKeyword index="K" term="version, 1.0.1.0" />
20+
</HelpKeywords>
21+
</Topic>
1722
</Topic>
1823
</Topics>

ITimer.Documentation/ITimer.Documentation.shfbproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
</ItemGroup>
8282
<ItemGroup>
8383
<None Include="Content\VersionHistory\v1.0.0.0.aml" />
84+
<None Include="Content\VersionHistory\v1.0.1.0.aml" />
8485
<None Include="Content\VersionHistory\VersionHistory.aml" />
8586
<None Include="Content\Welcome.aml" />
8687
</ItemGroup>

ITimer/ISignaler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace ITimer
1212
/// and <see cref="ISignaler" /> as interface name. If you have any better suggestions, please let us know and
1313
/// we'll consider it for the next major version.
1414
/// </remarks>
15-
public interface ISignaler
15+
public interface ISignaler : IDisposable
1616
{
1717
/// <summary>
1818
/// Occurs when the interval elapses.

ITimer/ITimer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<RepositoryUrl>https://github.com/RobThree/ITimer</RepositoryUrl>
1212
<RepositoryType>Git</RepositoryType>
1313
<PackageTags>timer clock</PackageTags>
14-
<Version>1.0.0</Version>
14+
<Version>1.0.1</Version>
1515
<Description>Provides a testable abstraction and alternative to System.Threading.Timer and System.Timers.Timer</Description>
1616
<PackageIcon>logo.png</PackageIcon>
1717
<Configurations>Debug;Release;ReleaseWithDocumentation</Configurations>
18-
<PackageReleaseNotes>Initial release</PackageReleaseNotes>
18+
<PackageReleaseNotes>Move IDisposable from timers to interface</PackageReleaseNotes>
1919
</PropertyGroup>
2020

2121
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithDocumentation|AnyCPU'">

ITimer/SystemTimer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ITimer
77
/// <summary>
88
/// Provides a wrapper for the <see cref="System.Timers.Timer" /> implementing the <see cref="ISignaler" /> interface.
99
/// </summary>
10-
public class SystemTimer : BaseTimer, ISignaler, IDisposable
10+
public class SystemTimer : BaseTimer, ISignaler
1111
{
1212
private bool _disposed;
1313
private readonly Timer _timer;

ITimer/TestTimer.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,28 @@ public void Reset()
168168
_startcount = 0;
169169
_stopcount = 0;
170170
}
171+
172+
#region IDisposable
173+
/// <summary>
174+
/// Releases all resources used by the current <see cref="ThreadingTimer" />.
175+
/// </summary>
176+
/// <param name="disposing">
177+
/// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.
178+
/// </param>
179+
protected virtual void Dispose(bool disposing)
180+
{
181+
//NOP
182+
}
183+
184+
/// <summary>
185+
/// Releases all resources used by the current <see cref="ThreadingTimer" />.
186+
/// </summary>
187+
public void Dispose()
188+
{
189+
Dispose(disposing: true);
190+
GC.SuppressFinalize(this);
191+
}
192+
#endregion
171193
}
172194

173195
/// <summary>

ITimer/ThreadingTimer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ITimer
66
/// <summary>
77
/// Provides a wrapper for the <see cref="System.Threading.Timer" /> implementing the <see cref="ISignaler" /> interface.
88
/// </summary>
9-
public class ThreadingTimer : BaseTimer, ISignaler, IDisposable
9+
public class ThreadingTimer : BaseTimer, ISignaler
1010
{
1111
private bool _disposed;
1212
private readonly Timer _timer;

0 commit comments

Comments
 (0)