internal void Initialize(string[] stateBaseConfiguration) { this.SetNirwana(); // For all source states do walk up the tree and set the state configuration entries foreach (string stateName in stateBaseConfiguration) { State state = m_stateMachineTemplate.FindState(stateName); if (state == null) { // There is no state corresponding to this transi's stateId throw new ArgumentOutOfRangeException("stateBaseConfiguration", FrameworkAbstractionUtils.StringFormat("Cannot find the State \"{0}\".", stateName)); } while (state != null) { Region parentRegion = state.Parent; int stateConfigurationIndex = parentRegion.StateConfigurationIndex; State state0 = this.GetState(parentRegion); // If a previous "foreach" stateName has already entered a value, // check whether that one matches with the current value. if ((state0 != State.Wildcard) && (state0 != state)) { // Mutual exclusive definition of source states throw new ArgumentOutOfRangeException("stateBaseConfiguration", FrameworkAbstractionUtils.StringFormat("The list of states contains mutually exclusive states \"{0}\" and \"{1}\".", stateName, state0.Name)); } m_states[stateConfigurationIndex] = state; // Step up one level state = parentRegion.Parent; } } }
/// <summary> /// Returns the execution order of the <see cref="Region"/>. /// </summary> /// <returns> /// Returns the <see cref="ExecutionOrder"/> value formatted as a <see cref="string"/>. /// </returns> public override string ToString() { return(FrameworkAbstractionUtils.Int32ToString(this.ExecutionOrder)); }