internal void ProcessActions(ActivityExecutionContext context) { if (context == null) { throw new ArgumentNullException("context"); } if (!this.SchedulerBusy) { StateActivity state = (StateActivity)context.Activity; if (this.Actions.Count == 0) { this.SubscriptionManager.ProcessQueue(context); } else { StateMachineAction action = this.Actions.Peek(); while (action.StateName.Equals(state.QualifiedName)) { action = this.DequeueAction(); action.Execute(context); if (this.SchedulerBusy) { return; } if (this.Actions.Count == 0) { break; } action = this.Actions.Peek(); } if (this.Actions.Count > 0) { StateActivity activity3 = StateMachineHelpers.FindDynamicStateByName(StateMachineHelpers.GetRootState(state), action.StateName); if (activity3 == null) { throw new InvalidOperationException(SR.GetInvalidStateMachineAction(action.StateName)); } activity3.RaiseProcessActionEvent(context); } else { this.SubscriptionManager.ProcessQueue(context); } } } }
internal void ProcessActions(ActivityExecutionContext context) { if (context == null) { throw new ArgumentNullException("context"); } if (this.SchedulerBusy) { return; } StateActivity state = (StateActivity)context.Activity; if (this.Actions.Count == 0) { this.SubscriptionManager.ProcessQueue(context); return; } StateMachineAction action = this.Actions.Peek(); while (action.StateName.Equals(state.QualifiedName)) { action = DequeueAction(); action.Execute(context); // If the previous action just // requested something to the runtime // scheduler, then we quit, since // the scheduler takes precedence. // we'll pick up the processing of actions // after the scheduler return the control to us. if (this.SchedulerBusy) { return; } if (this.Actions.Count == 0) { break; } action = this.Actions.Peek(); } if (this.Actions.Count > 0) { StateActivity rootState = StateMachineHelpers.GetRootState(state); StateActivity nextActionState = StateMachineHelpers.FindDynamicStateByName(rootState, action.StateName); if (nextActionState == null) { throw new InvalidOperationException(SR.GetInvalidStateMachineAction(action.StateName)); } nextActionState.RaiseProcessActionEvent(context); } else { this.SubscriptionManager.ProcessQueue(context); } }