1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #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
- using System;
- namespace Wayne.Lib.StateEngine
- {
- /// <summary>
- /// 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.
- /// </summary>
- [EnterDescription("", BasicTransitionType.Done)]
- abstract public class FinalState : State
- {
- /// <summary>
- /// Override to add Enter code to the Final State.
- /// </summary>
- /// <param name="stateEntry">Information about the state entry.</param>
- /// <param name="transition">Set to a transition object to perform a transition.</param>
- 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);
- }
- }
- }
|