private void SetSpeed(CeilingFanSpeed speed)
        {
            switch (speed)
            {
            case CeilingFanSpeed.Low:
                Target.Low();
                break;

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

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

            case CeilingFanSpeed.Off:
                Target.Off();
                break;
            }
        }
Example #2
0
 /// <summary>
 /// 关闭
 /// </summary>
 public void Off()
 {
     Speed = CeilingFanSpeed.OFF;
     OnSpeedChange();
 }
Example #3
0
 /// <summary>
 /// 设置为中档转速
 /// </summary>
 public void Medium()
 {
     Speed = CeilingFanSpeed.MEDIUM;
     OnSpeedChange();
 }
Example #4
0
 public CeilingFan(string location)
 {
     _location = location;            //吊扇的位置
     Speed     = CeilingFanSpeed.OFF; // 吊扇初始为关闭
 }
Example #5
0
 public void ChangeSpeed(CeilingFanSpeed newSpeed) => CurrentSpeed = newSpeed;
Example #6
0
 public void Execute()
 {
     _prevSpeed = _ceilingFan.Speed;
     _ceilingFan.medium();
 }
 public void high()
 {
     // turns the ceiling fan on to high
     Speed = CeilingFanSpeed.High;
     Console.WriteLine(_location + " ceiling fan is on high");
 }
Example #8
0
 public void medium()
 {
     // turns the ceiling fan on to medium
     Speed = CeilingFanSpeed.Medium;
     Console.WriteLine(_location + " ceiling fan is on medium");
 }
 public void SetLowSpeed()
 {
     _speed = CeilingFanSpeed.Low;
     Console.WriteLine("{0} ceiling fan is on low", _location);
 }
 public void SetOff()
 {
     _speed = CeilingFanSpeed.Off;
     Console.WriteLine("{0} ceiling fan is off", _location);
 }
Example #11
0
 public void Medium()
 {
     Speed = CeilingFanSpeed.Medium;
     Console.WriteLine(_location + " ceiling fan is on medium");
 }
Example #12
0
 public void Low()
 {
     Speed = CeilingFanSpeed.Low;
     Console.WriteLine(_location + " ceiling fan is on low");
 }
Example #13
0
 public void High()
 {
     Speed = CeilingFanSpeed.High;
     Console.WriteLine(_location + " ceiling fan is on high");
 }
Example #14
0
 public void Execute()
 {
     _prevSpeed = _ceilingFan.Speed;
     _ceilingFan.medium();
 }
 public void medium()
 {
     // turns the ceiling fan on to medium
     Speed = CeilingFanSpeed.Medium;
     Console.WriteLine(_location + " ceiling fan is on medium");
 }
Example #16
0
 public void high()
 {
     // turns the ceiling fan on to high
     Speed = CeilingFanSpeed.High;
     Console.WriteLine(_location + " ceiling fan is on high");
 }
 public void low()
 {
     // turns the ceiling fan on to low
     Speed = CeilingFanSpeed.Low;
     Console.WriteLine(_location + " ceiling fan is on low");
 }
Example #18
0
 public void Execute()
 {
     _previousSpeed = _ceilingFan.Speed;
     _ceilingFan.Medium();
 }
 public void Off()
 {
     // turns the ceiling fan off
     Speed = CeilingFanSpeed.Off;
     Console.WriteLine(_location + " ceiling fan is off");
 }
Example #20
0
 public void Execute()
 {
     _previousSpeed = _ceilingFan.Speed;
     _ceilingFan.Medium();
 }
Example #21
0
 public override void Exequte()
 {
     _prevSpeed = Target.Speed;
     Target.Off();
 }
Example #22
0
 public void Execute(object parameter)
 {
     _prevSpeed = _ceilingFan.Speed;
     _ceilingFan.Off();
 }
Example #23
0
 public void High()
 {
     _speed = CeilingFanSpeed.High;
     Console.WriteLine("Ceiling fan HIGH.");
 }
Example #24
0
 public void TurnOff() => CurrentSpeed = CeilingFanSpeed.Off;
Example #25
0
 public void Low()
 {
     _speed = CeilingFanSpeed.Low;
     Console.WriteLine("Ceiling fan LOW.");
 }
Example #26
0
 /// <summary>
 /// 设置为高档转速
 /// </summary>
 public void High()
 {
     Speed = CeilingFanSpeed.HIGH;
     OnSpeedChange();
 }
Example #27
0
 public void Medium()
 {
     _speed = CeilingFanSpeed.Medium;
     Console.WriteLine("Ceiling fan MEDIUM.");
 }
Example #28
0
 /// <summary>
 /// 设置为低档转速
 /// </summary>
 public void Low()
 {
     Speed = CeilingFanSpeed.LOW;
     OnSpeedChange();
 }
Example #29
0
 public void Off()
 {
     _speed = CeilingFanSpeed.Off;
     Console.WriteLine("Ceiling fan OFF.");
 }
Example #30
0
 public void Execute()
 {
     _prevSpeed = _ceilingFan.Speed;
     _ceilingFan.High();
 }
Example #31
0
 public CeilingFan(string location)
 {
     _speed    = CeilingFanSpeed.Off;
     _location = location;
 }
Example #32
0
 public void Execute()
 {
     _prevSpeed = _ceilingFan.Speed;
     _ceilingFan.Off();
 }
Example #33
0
 public void High()
 {
     _speed = CeilingFanSpeed.High;
     Console.WriteLine($"{_location} ceiling fan is high!");
 }
Example #34
0
 public void low()
 {
     // turns the ceiling fan on to low
     Speed = CeilingFanSpeed.Low;
     Console.WriteLine(_location + " ceiling fan is on low");
 }
Example #35
0
 public void Medium()
 {
     _speed = CeilingFanSpeed.Medium;
     Console.WriteLine($"{_location} ceiling fan is medium!");
 }
Example #36
0
 public void Off()
 {
     // turns the ceiling fan off
     Speed = CeilingFanSpeed.Off;
     Console.WriteLine(_location + " ceiling fan is off");
 }
Example #37
0
 public void Low()
 {
     _speed = CeilingFanSpeed.Low;
     Console.WriteLine($"{_location} ceiling fan is low!");
 }
 public override void Exequte()
 {
     _prevSpeed = Target.Speed;
     SetSpeed(_currentSpeed);
 }
Example #39
0
 public void Off()
 {
     _speed = CeilingFanSpeed.Off;
     Console.WriteLine($"{_location} ceiling fan is off!");
 }
 public CeilingFanOnCommand(CeilingFan target, CeilingFanSpeed speed)
     : base(target)
 {
     _currentSpeed = speed;
 }
Example #41
0
 public void Execute()
 {
     _previousSpeed = _ceilingFan.Speed;
     _ceilingFan.High();
 }