123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- namespace Wayne.Lib.StateEngine
- {
- /// <summary>
- /// Argument in the StateChanged events. It contains the new and the old state in a state transition.
- /// </summary>
- public class StateChangedEventArgs : EventArgs
- {
- #region Fields
- State oldState;
- State newState;
- Transition transition;
- #endregion
- #region Construction
- /// <summary>
- /// Constructor for the StateChanged Event Arguments
- /// </summary>
- /// <param name="oldState">The State object representing the state that was exited.</param>
- /// <param name="newState">The State object representing the state that was entered.</param>
- /// <param name="transition">The Transition.</param>
- public StateChangedEventArgs(State oldState, State newState, Transition transition)
- {
- this.oldState = oldState;
- this.newState = newState;
- this.transition = transition;
- }
- #endregion
- #region Properties
- /// <summary>
- /// The state that is exited
- /// </summary>
- public State OldState
- {
- get { return oldState; }
- }
- /// <summary>
- /// The new state that is entered.
- /// </summary>
- public State NewState
- {
- get { return newState; }
- }
- /// <summary>
- /// The Transition.
- /// </summary>
- public Transition Transition
- {
- get { return transition; }
- }
- #endregion
- }
- }
|