Ejemplo n.º 1
0
        public static TActivityNode ConnectCancellationTo <TActivityNode>(
            [NotNull] this TActivityNode from, [NotNull] IActivityNode to)
            where TActivityNode : ActivityNode
        {
            from.AssertNotNull("from != null");
            to.AssertNotNull("to != null");
            from.CancellationHandler.AssertIsNull("Cancellation handler is already set");

            from.CancellationHandler = to;
            return(from);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public void SubscribeToExceptionsOf(IActivityNode node)
 {
     node.AssertNotNull("node != null");
     Bind(x => x.Exception).ToExceptionOf(node);
 }