protected virtual void OnStateMachineComplete(IStateTransition finalTransition) { var transitionArgs = new StateTransitionEventArgs { StateMachineContext = this, StartingState = null, Transition = finalTransition, TransitionPhase = StateTransitionPhase.All }; EventHandler <StateTransitionEventArgs> evt = StateMachineComplete; if (evt != null) { evt(this, transitionArgs); } }
protected virtual void OnStateInitialized(IStateTransition transition, IStateMachineState prevState) { var transitionArgs = new StateTransitionEventArgs { StateMachineContext = this, StartingState = prevState, Transition = transition, TransitionPhase = StateTransitionPhase.StateInitialization }; EventHandler <StateTransitionEventArgs> stateInitializedHandler = StateInitialized; if (stateInitializedHandler != null) { stateInitializedHandler(this, transitionArgs); } }