| @@ -7,8 +7,6 | |||
| 
             | 
        7 | 7 | <OutputType>Library</OutputType> | 
| 
             | 
        8 | 8 | <RootNamespace>Implab</RootNamespace> | 
| 
             | 
        9 | 9 | <AssemblyName>Implab</AssemblyName> | 
| 
             | 
        10 | <ProductVersion>8.0.30703</ProductVersion> | |
| 
             | 
        11 | <SchemaVersion>2.0</SchemaVersion> | |
| 
             | 
        12 | 10 | </PropertyGroup> | 
| 
             | 
        13 | 11 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | 
| 
             | 
        14 | 12 | <DebugSymbols>true</DebugSymbols> | 
| @@ -58,6 +58,21 namespace Implab | |||
| 
             | 
        58 | 58 | } | 
| 
             | 
        59 | 59 | |
| 
             | 
        60 | 60 | [DebuggerStepThrough] | 
| 
             | 
        61 | public static IPromise<T> InvokePromise<T>(Action action) { | |
| 
             | 
        62 | ArgumentNotNull(action, "action"); | |
| 
             | 
        63 | ||
| 
             | 
        64 | var p = new Promise<object>(); | |
| 
             | 
        65 | try { | |
| 
             | 
        66 | action(); | |
| 
             | 
        67 | p.Resolve(); | |
| 
             | 
        68 | } catch (Exception err) { | |
| 
             | 
        69 | p.Reject(err); | |
| 
             | 
        70 | } | |
| 
             | 
        71 | ||
| 
             | 
        72 | return p; | |
| 
             | 
        73 | } | |
| 
             | 
        74 | ||
| 
             | 
        75 | [DebuggerStepThrough] | |
| 
             | 
        61 | 76 | public static IPromise<T> InvokePromise<T>(Func<IPromise<T>> action) { | 
| 
             | 
        62 | 77 | ArgumentNotNull(action, "action"); | 
| 
             | 
        63 | 78 | |
        
        General Comments 0
    
    
  
  
                      You need to be logged in to leave comments.
                      Login now
                    
                