public void Undo() { switch (_speedStack.Pop()) { case FanSpeed.High: _ceilingFan.High(); break; case FanSpeed.Medium: _ceilingFan.Medium(); break; case FanSpeed.Low: _ceilingFan.Low(); break; case FanSpeed.Off: _ceilingFan.Off(); break; default: throw new ArgumentOutOfRangeException(); } }
public void Execute() { _speedStack.Push(_ceilingFan.GetSpeed()); _ceilingFan.Low(); }