Пример #1
0
 public void Execute()
 {
     _previousState = _stero.CurrentState;
     _stero.PowerOn();
     _stero.Volume = 11;
     _stero.TurnToCD();
 }
Пример #2
0
 public void Undo()
 {
     if (_previousState == Stero.State.CD)
     {
         _stero.PowerOn();
         _stero.Volume = _previousVolume;
         _stero.TurnToCD();
         return;
     }
     if (_previousState == Stero.State.DVD)
     {
         _stero.PowerOn();
         _stero.Volume = _previousVolume;
         _stero.TurnToDVD();
         return;
     }
     if (_previousState == Stero.State.Radio)
     {
         _stero.PowerOn();
         _stero.Volume = _previousVolume;
         _stero.TurnToradio();
         return;
     }
     if (_previousState == Stero.State.Off)
     {
         _stero.PowerOff();
         _stero.Volume = _previousVolume;
         return;
     }
 }