Example #1
0
        /// <summary>
        /// Enters this state.
        /// </summary>
        /// <param name="stateContext">The event context.</param>
        public void Entry(IStateContext <TState, TEvent> stateContext)
        {
            Ensure.ArgumentNotNull(stateContext, "stateContext");

            stateContext.AddRecord(this.Id, RecordType.Enter);

            this.ExecuteEntryActions(stateContext);
        }
Example #2
0
        /// <summary>
        /// Exits this state, executes the exit action and sets the <see cref="LastActiveState"/> on the super-state.
        /// </summary>
        /// <param name="stateContext">The event context.</param>
        public void Exit(IStateContext <TState, TEvent> stateContext)
        {
            Ensure.ArgumentNotNull(stateContext, "stateContext");

            stateContext.AddRecord(this.Id, RecordType.Exit);

            this.ExecuteExitActions(stateContext);
            this.SetThisStateAsLastStateOfSuperState();
        }