| @@ -7,8 +7,6 | |||||
| 7 | <OutputType>Library</OutputType> | 
             | 
        7 | <OutputType>Library</OutputType> | |
| 8 | <RootNamespace>Implab</RootNamespace> | 
             | 
        8 | <RootNamespace>Implab</RootNamespace> | |
| 9 | <AssemblyName>Implab</AssemblyName> | 
             | 
        9 | <AssemblyName>Implab</AssemblyName> | |
| 10 | <ProductVersion>8.0.30703</ProductVersion> | 
             | 
        |||
| 11 | <SchemaVersion>2.0</SchemaVersion> | 
             | 
        |||
| 12 | </PropertyGroup> | 
             | 
        10 | </PropertyGroup> | |
| 13 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | 
             | 
        11 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
| 14 | <DebugSymbols>true</DebugSymbols> | 
             | 
        12 | <DebugSymbols>true</DebugSymbols> | |
| @@ -58,6 +58,21 namespace Implab | |||||
| 58 | } | 
             | 
        58 | } | |
| 59 | 
             | 
        59 | |||
| 60 | [DebuggerStepThrough] | 
             | 
        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 | public static IPromise<T> InvokePromise<T>(Func<IPromise<T>> action) { | 
             | 
        76 | public static IPromise<T> InvokePromise<T>(Func<IPromise<T>> action) { | |
| 62 | ArgumentNotNull(action, "action"); | 
             | 
        77 | ArgumentNotNull(action, "action"); | |
| 63 | 
             | 
        78 | |||
        
        General Comments 0
    
    
  
  
                      You need to be logged in to leave comments.
                      Login now
                    
                