bool ExecuteSingleNode(NativeActivityContext context, FlowNode node, out FlowNode nextNode)
        {
            Fx.Assert(node != null, "caller should validate");
            FlowStep step = node as FlowStep;

            if (step != null)
            {
                if (this.onStepCompleted == null)
                {
                    this.onStepCompleted = new CompletionCallback(this.OnStepCompleted);
                }

                return(step.Execute(context, this.onStepCompleted, out nextNode));
            }

            nextNode = null;
            FlowDecision decision = node as FlowDecision;

            if (decision != null)
            {
                if (this.onDecisionCompleted == null)
                {
                    this.onDecisionCompleted = new CompletionCallback <bool>(this.OnDecisionCompleted);
                }

                return(decision.Execute(context, this.onDecisionCompleted));
            }

            IFlowSwitch switchNode = node as IFlowSwitch;

            Fx.Assert(switchNode != null, "unrecognized FlowNode");

            return(switchNode.Execute(context, this));
        }
Example #2
0
        private bool ExecuteSingleNode(NativeActivityContext context, FlowNode node, out FlowNode nextNode)
        {
            FlowStep step = node as FlowStep;

            if (step != null)
            {
                if (this.onStepCompleted == null)
                {
                    this.onStepCompleted = new CompletionCallback(this.OnStepCompleted);
                }
                return(step.Execute(context, this.onStepCompleted, out nextNode));
            }
            nextNode = null;
            FlowDecision decision = node as FlowDecision;

            if (decision != null)
            {
                if (this.onDecisionCompleted == null)
                {
                    this.onDecisionCompleted = new CompletionCallback <bool>(this.OnDecisionCompleted);
                }
                return(decision.Execute(context, this.onDecisionCompleted));
            }
            IFlowSwitch switch2 = node as IFlowSwitch;

            return(switch2.Execute(context, this));
        }