/// <summary> /// Enters the state. /// </summary> /// <param name="context">The event arguments pertaining to the transition into the state.</param> /// <param name="useHistory">Used by history states to reconstitute state history.</param> /// <remarks> /// This method is for use only by the North State Framework's internal logic. /// </remarks> protected internal virtual void enter(NSFStateMachineContext context, bool useHistory) { active = true; if (parentRegion != null) { parentRegion.setActiveSubstate(this); if (!parentRegion.isActive()) { parentRegion.enter(context, false); } } if (TopStateMachine.LoggingEnabled && LogEntry) { NSFTraceLog.PrimaryTraceLog.addTrace(NSFTraceTags.StateEnteredTag, NSFTraceTags.StateMachineTag, TopStateMachine.Name, NSFTraceTags.StateTag, Name); } // Update context to indicate entering this state context.EnteringState = this; context.ExitingState = null; EntryActions.execute(context); NSFStateMachine parentStateMachine = ParentStateMachine; if (parentStateMachine != null) { parentStateMachine.executeStateChangeActions(context); } }
/// <summary> /// Executes the actions in the state change actions list. /// </summary> internal void executeStateChangeActions(NSFStateMachineContext context) { StateChangeActions.execute(context); NSFStateMachine parentStateMachine = ParentStateMachine; if (parentStateMachine != null) { parentStateMachine.executeStateChangeActions(context); } }