/// <summary> /// Throws an exception if the new initial state is this instance. /// </summary> /// <param name="newInitialState">The value.</param> // ReSharper disable once UnusedParameter.Local private void CheckInitialStateIsNotThisInstance(IState <TState, TEvent> newInitialState) { if (this == newInitialState) { throw new ArgumentException(StatesExceptionMessages.StateCannotBeTheInitialSubStateToItself(this.ToString())); } }
/// <summary> /// Throws an exception if the new initial state is not a sub-state of this instance. /// </summary> /// <param name="value">The value.</param> private void CheckInitialStateIsASubState(IState <TState, TEvent> value) { if (value.SuperState != this) { throw new ArgumentException(StatesExceptionMessages.StateCannotBeTheInitialStateOfSuperStateBecauseItIsNotADirectSubState(value.ToString(), this.ToString())); } }
/// <summary> /// Throws an exception if the new super state is this instance. /// </summary> /// <param name="newSuperState">The value.</param> // ReSharper disable once UnusedParameter.Local private void CheckSuperStateIsNotThisInstance(IState <TState, TEvent> newSuperState) { if (this == newSuperState) { throw new ArgumentException(StatesExceptionMessages.StateCannotBeItsOwnSuperState(this.ToString())); } }