# HG changeset patch # User cin # Date 2014-10-29 15:54:46 # Node ID 0141a165d0329eb4588335c2da64e3802bc0aa65 # Parent a43745f81f1064a48a4a788b9dac24a9a07fa3b1 minor changes diff --git a/Implab/Implab.csproj b/Implab/Implab.csproj --- a/Implab/Implab.csproj +++ b/Implab/Implab.csproj @@ -7,8 +7,6 @@ Library Implab Implab - 8.0.30703 - 2.0 true diff --git a/Implab/Safe.cs b/Implab/Safe.cs --- a/Implab/Safe.cs +++ b/Implab/Safe.cs @@ -58,6 +58,21 @@ namespace Implab } [DebuggerStepThrough] + public static IPromise InvokePromise(Action action) { + ArgumentNotNull(action, "action"); + + var p = new Promise(); + try { + action(); + p.Resolve(); + } catch (Exception err) { + p.Reject(err); + } + + return p; + } + + [DebuggerStepThrough] public static IPromise InvokePromise(Func> action) { ArgumentNotNull(action, "action");