protected void ChangeStateToWithPin(AlarmSystemState newStateType, string pinCode) { if (Context.CheckPinCode(pinCode) == PinCheckResult.CORRECT) { Context.ChangeState(this.StateType, newStateType); } }
public void ChangeState(AlarmSystemState oldStateType, AlarmSystemState newStateType) { if (oldStateType == newStateType) { return; } CurrentState = newStateType; AlarmSystemStates[CurrentState].GotActive(); if (StateChanged != null) { StateChanged(this, new StateChangedEventArgs(oldStateType, newStateType)); } }
public StateChangedEventArgs(AlarmSystemState oldStateType, AlarmSystemState newStateType) { this.OldStateType = oldStateType; this.NewStateType = newStateType; }
protected void ChangeStateTo(AlarmSystemState newStateType) { Context.ChangeState(this.StateType, newStateType); }
protected AlarmSystemStateBase(Context context, AlarmSystemState stateType) { this.Context = context; this.StateType = stateType; }