Mercurial > pub > ImplabNet
comparison Implab/Components/Disposable.cs @ 208:7d07503621fe v2
RunnableComponent.Dispose(bool,Exception) changed to standart Dispose(bool)
IRunnable is now disposable
Code cleanups, suppressed some CodeAnalysis warnings
author | cin |
---|---|
date | Sun, 13 Nov 2016 18:28:17 +0300 |
parents | 240aa6994018 |
children | 9ee78a345738 |
comparison
equal
deleted
inserted
replaced
207:558f34b2fb50 | 208:7d07503621fe |
---|---|
1 using Implab.Diagnostics; | 1 using Implab.Diagnostics; |
2 using System; | 2 using System; |
3 using System.Diagnostics.CodeAnalysis; | |
3 using System.Threading; | 4 using System.Threading; |
4 | 5 |
5 namespace Implab.Components { | 6 namespace Implab.Components { |
6 /// <summary> | 7 /// <summary> |
7 /// Base class the objects which support disposing. | 8 /// Base class the objects which support disposing. |
79 if (temp != null) | 80 if (temp != null) |
80 temp(this, EventArgs.Empty); | 81 temp(this, EventArgs.Empty); |
81 } | 82 } |
82 } | 83 } |
83 | 84 |
85 [SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification = "Dipose(bool) and GC.SuppessFinalize are called")] | |
84 public void Dispose() { | 86 public void Dispose() { |
85 if (Interlocked.Increment(ref m_disposed) == 1) { | 87 if (Interlocked.Increment(ref m_disposed) == 1) { |
86 Dispose(true); | 88 Dispose(true); |
87 GC.SuppressFinalize(this); | 89 GC.SuppressFinalize(this); |
88 } | 90 } |