Ejemplo n.º 1
0
        public ActivityGroup Cancelled(SingleActivity next)
        {
            if (next == null) throw new ArgumentNullException("next");

            OnCancel = next;
            return this;
        }
Ejemplo n.º 2
0
        public static SingleActivity Failed <T>(this SingleActivity activity,
                                                Expression <Func <T, Task <Activity> > > func)
        {
            if (activity == null)
            {
                throw new ArgumentNullException("activity");
            }

            return(activity.Failed(Activity.Run(func)));
        }
Ejemplo n.º 3
0
        public static SingleActivity ExceptionFilter <TFilter>(this SingleActivity activity,
                                                               Expression <Action <ExceptionContext, TFilter> > filter)
        {
            if (activity == null)
            {
                throw new ArgumentNullException("activity");
            }
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            activity.ExceptionFiltersList.Add(Dependable.ExceptionFilter.From(filter));
            return(activity);
        }
Ejemplo n.º 4
0
        static SingleActivity ThenCore <T>(Activity first, LambdaExpression func)
        {
            if (first == null)
            {
                throw new ArgumentNullException("first");
            }
            if (func == null)
            {
                throw new ArgumentNullException("func");
            }

            var method = func.ToMethodCall();
            var next   = new SingleActivity(typeof(T), method.Name, method.Arguments);

            return((SingleActivity)first.Then(next));
        }