# HG changeset patch # User cin # Date 2017-04-10 22:35:18 # Node ID 9ee78a345738900193b23d8f2d5e1eca99334312 # Parent a01d9df88d74c741fdf3def358092664e54e23e9 Minor code changes diff --git a/Implab/Components/Disposable.cs b/Implab/Components/Disposable.cs --- a/Implab/Components/Disposable.cs +++ b/Implab/Components/Disposable.cs @@ -8,7 +8,7 @@ namespace Implab.Components { /// Base class the objects which support disposing. /// public class Disposable : IDisposable { - + int m_disposed; public event EventHandler Disposed; @@ -75,11 +75,9 @@ namespace Implab.Components { /// из нескольких потоков. /// protected virtual void Dispose(bool disposing) { - if (disposing) { - EventHandler temp = Disposed; - if (temp != null) - temp(this, EventArgs.Empty); - } + if (disposing) + Disposed.DispatchEvent(this, EventArgs.Empty); + } [SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification = "Dipose(bool) and GC.SuppessFinalize are called")] diff --git a/Implab/Safe.cs b/Implab/Safe.cs --- a/Implab/Safe.cs +++ b/Implab/Safe.cs @@ -6,6 +6,10 @@ using System.Text.RegularExpressions; using System.Diagnostics; using System.Collections; +#if NET_4_5 +using System.Threading.Tasks; +#endif + namespace Implab { public static class Safe @@ -117,6 +121,9 @@ namespace Implab } } + public static void NoWait(IPromise promise) { + } + [DebuggerStepThrough] public static IPromise Run(Func> action) { ArgumentNotNull(action, "action"); @@ -128,5 +135,10 @@ namespace Implab } } +#if NET_4_5 + public static void NoWait(Task t) { + } +#endif + } }