comparison Implab/Safe.cs @ 205:8200ab154c8a v2

Added ResetState to RunnableComponent to reset in case of failure Added StateChanged event to IRunnable Renamed Promise.SUCCESS -> Promise.Success Added Promise.FromException Renamed Bundle -> PromiseAll in PromiseExtensions
author cin
date Tue, 25 Oct 2016 17:40:33 +0300
parents 4d9830a9bbb8
children 558f34b2fb50
comparison
equal deleted inserted replaced
203:4d9830a9bbb8 205:8200ab154c8a
81 public static IPromise Run(Action action) { 81 public static IPromise Run(Action action) {
82 ArgumentNotNull(action, "action"); 82 ArgumentNotNull(action, "action");
83 83
84 try { 84 try {
85 action(); 85 action();
86 return Promise.SUCCESS; 86 return Promise.Success;
87 } catch (Exception err) { 87 } catch (Exception err) {
88 return new FailedPromise(err); 88 return new FailedPromise(err);
89 } 89 }
90 } 90 }
91 91