internal void RegisterActivityTaskHandler([NotNull] ActivityTaskHandler handler) { handler.AssertNotNull("handler != null"); if (myTaskHandlers == null) { myTaskHandlers = new List <ActivityTaskHandler>(); } myTaskHandlers.Add(handler); }
public override void RegisterActivityTaskHandler(ActivityTaskHandler handler) { handler.AssertNotNull("handler != null"); if (myTaskHandlers == null) { myTaskHandlers = new List <ActivityTaskHandler>(); } myTaskHandlers.Add(handler); }
public void ToExceptionOf([NotNull] IActivityNode activity) { activity.AssertNotNull("activity != null"); var bindingInfo = new FaultBinding(myPropertyName, activity); myActivityDescriptor.AddBindingInfo(bindingInfo); ActivityTaskHandler handler = task => { if (task.Status == TaskStatus.Faulted) { myActivityDescriptor.AddInitializer(a => SetProperty(a, task.Exception)); } }; activity.RegisterActivityTaskHandler(handler); }
public void ToResultOf <TAnotherActivity>([NotNull] ActivityDescriptor <TAnotherActivity> descriptor) where TAnotherActivity : class, IActivity <TProperty> { descriptor.AssertNotNull("descriptor != null"); var bindingInfo = new ResultBinding <TProperty, TAnotherActivity>(myPropertyName, descriptor); myActivityDescriptor.AddBindingInfo(bindingInfo); ActivityTaskHandler handler = task => { if (task.Status == TaskStatus.RanToCompletion) { myActivityDescriptor.AddInitializer(a => SetProperty(a, task.Result)); } }; descriptor.RegisterActivityTaskHandler(handler); }
public abstract void RegisterActivityTaskHandler(ActivityTaskHandler handler);
public override void RegisterActivityTaskHandler(ActivityTaskHandler handler) { handler.AssertNotNull("handler != null"); myActivityDescriptor.RegisterActivityTaskHandler(handler); }