changeset 95:0141a165d032 v2

minor changes
author cin
date Wed, 29 Oct 2014 18:54:46 +0300
parents a43745f81f10
children daffa72a1cec
files Implab/Implab.csproj Implab/Safe.cs
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Implab/Implab.csproj	Thu Oct 23 17:50:09 2014 +0400
+++ b/Implab/Implab.csproj	Wed Oct 29 18:54:46 2014 +0300
@@ -7,8 +7,6 @@
     <OutputType>Library</OutputType>
     <RootNamespace>Implab</RootNamespace>
     <AssemblyName>Implab</AssemblyName>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
--- a/Implab/Safe.cs	Thu Oct 23 17:50:09 2014 +0400
+++ b/Implab/Safe.cs	Wed Oct 29 18:54:46 2014 +0300
@@ -58,6 +58,21 @@
         }
 
         [DebuggerStepThrough]
+        public static IPromise<T> InvokePromise<T>(Action action) {
+            ArgumentNotNull(action, "action");
+
+            var p = new Promise<object>();
+            try {
+                action();
+                p.Resolve();
+            } catch (Exception err) {
+                p.Reject(err);
+            }
+
+            return p;
+        }
+
+        [DebuggerStepThrough]
         public static IPromise<T> InvokePromise<T>(Func<IPromise<T>> action) {
             ArgumentNotNull(action, "action");