Mercurial > pub > ImplabNet
comparison Implab/Safe.cs @ 132:5fb2bbffdece v2
minor fixes
author | cin |
---|---|
date | Sat, 07 Feb 2015 19:41:31 +0300 |
parents | b5c2d609d71b |
children | 6c49d02a9a05 |
comparison
equal
deleted
inserted
replaced
131:b5c2d609d71b | 132:5fb2bbffdece |
---|---|
55 if (d != null) | 55 if (d != null) |
56 d.Dispose(); | 56 d.Dispose(); |
57 } | 57 } |
58 | 58 |
59 [DebuggerStepThrough] | 59 [DebuggerStepThrough] |
60 public static IPromise<T> InvokePromise<T>(Func<T> action) { | 60 public static IPromise<T> WrapPromise<T>(Func<T> action) { |
61 ArgumentNotNull(action, "action"); | 61 ArgumentNotNull(action, "action"); |
62 | 62 |
63 var p = new Promise<T>(); | 63 var p = new Promise<T>(); |
64 try { | 64 try { |
65 p.Resolve(action()); | 65 p.Resolve(action()); |
69 | 69 |
70 return p; | 70 return p; |
71 } | 71 } |
72 | 72 |
73 [DebuggerStepThrough] | 73 [DebuggerStepThrough] |
74 public static IPromise InvokePromise(Action action) { | 74 public static IPromise WrapPromise(Action action) { |
75 ArgumentNotNull(action, "action"); | 75 ArgumentNotNull(action, "action"); |
76 | 76 |
77 var p = new Promise(); | 77 var p = new Promise(); |
78 try { | 78 try { |
79 action(); | 79 action(); |