Exemple #1
0
        public void Undo()
        {
            switch (prevSpeed)
            {
            case Speed.High:
                fan.High();
                break;

            case Speed.Low:
                fan.Low();
                break;

            case Speed.Medium:
                fan.Medium();
                break;

            case Speed.Off:
                fan.Off();
                break;

            default:
                fan.Off();
                break;
            }
        }
 public void Undo()
 {
     if (_prevSpeed == CeilingFanSpeed.HIGH)
     {
         _ceilingFan.High();
     }
     else if (_prevSpeed == CeilingFanSpeed.MEDIUM)
     {
         _ceilingFan.Medium();
     }
     else if (_prevSpeed == CeilingFanSpeed.LOW)
     {
         _ceilingFan.Low();
     }
     else
     {
         _ceilingFan.Off();
     }
 }
Exemple #3
0
 public void undo()
 {
     if (prevSpeed == CeilingFan.high)
     {
         ceilingFan.High();
     }
     else if (prevSpeed == CeilingFan.medium)
     {
         ceilingFan.Medium();
     }
     else if (prevSpeed == CeilingFan.low)
     {
         ceilingFan.Low();
     }
     else if (prevSpeed == CeilingFan.off)
     {
         ceilingFan.Off();
     }
 }
 public void Undo()
 {
     if (previousSpeed == CeilingFan.HIGH)
     {
         ceilingFan.High();
     }
     else if (previousSpeed == CeilingFan.LOW)
     {
         ceilingFan.Low();
     }
     else if (previousSpeed == CeilingFan.MEDIUM)
     {
         ceilingFan.Medium();
     }
     else if (previousSpeed == CeilingFan.OFF)
     {
         ceilingFan.Off();
     }
 }
Exemple #5
0
        public void Undo()
        {
            switch (_previousSpeed)
            {
            case CeilingFanSpeed.Low:
                _ceilingFan.Low();
                break;

            case CeilingFanSpeed.Medium:
                _ceilingFan.Medium();
                break;

            case CeilingFanSpeed.High:
                _ceilingFan.High();
                break;

            case CeilingFanSpeed.Off:
                _ceilingFan.Off();
                break;
            }
        }
Exemple #6
0
 public void Execute()
 {
     _previousSpeed = _ceilingFan.Speed;
     _ceilingFan.Medium();
 }
Exemple #7
0
 public void Execute()
 {
     prevSpeed = fan.GetSpeed();
     fan.Medium();
 }
Exemple #8
0
 public void execute()
 {
     prevSpeed = ceilingFan.getSpeed();
     ceilingFan.Medium();
 }
 public void Execute()
 {
     previousSpeed = ceilingFan.GetCurrentSpeed();
     ceilingFan.Medium();
 }