#region --------------- Copyright Dresser Wayne Pignone ------------- /* * $Log: /Wrk/WayneLibraries/Wrk/StateEngine/FinalState.cs $ * * 4 08-02-26 14:07 Mattias.larsson * Removed Obsolete method. * * 3 07-03-02 13:19 roger.månsson * Removed CLSCompliant(false) attribute. */ #endregion namespace Wayne.Lib.StateEngine { /// /// Final state represent an endpoint in a state machine. There can not be any transitions from this state to any other state in the /// same state machine. There can be several final states in /// one state machine. When the Final state has been reached, and after the Entry, the state engine /// will automatically post a BasicTransitionTypes.Done transition to the state machine above the state machine /// containing the final state. /// [EnterDescription("", BasicTransitionType.Done)] abstract public class FinalState : State { /// /// Override to add Enter code to the Final State. /// /// Information about the state entry. /// Set to a transition object to perform a transition. protected override void Enter(StateEntry stateEntry, ref Transition transition) { base.Enter(stateEntry, ref transition); //If this is the final state in the root state machine, fire the OnFinalStateEntered event. if (this.ParentStateMachine.ParentStateMachine == null) this.ParentStateMachine.FireFinalStateEntered(); transition = new Transition(this, BasicTransitionType.Done); } } }