Exemplo n.º 1
0
        private 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 (_onStepCompleted == null)
                {
                    _onStepCompleted = new CompletionCallback(this.OnStepCompleted);
                }

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

            nextNode = null;
            FlowDecision decision = node as FlowDecision;

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

                return(decision.Execute(context, _onDecisionCompleted));
            }

            IFlowSwitch switchNode = node as IFlowSwitch;

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

            return(switchNode.Execute(context, this));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        internal void OnSwitchCompleted <T>(NativeActivityContext context, ActivityInstance completedInstance, T result)
        {
            IFlowSwitch switchNode = this.GetCurrentNode(context) as IFlowSwitch;

            Fx.Assert(switchNode != null, "corrupt internal state");
            FlowNode next = switchNode.GetNextNode(result);

            this.ExecuteNodeChain(context, next, completedInstance);
        }