Example #1
0
        private static void Main(string[] args)
        {
            RemoteControl remoteControl = new RemoteControl();

            Ventilador ventilador = new Ventilador("Sala");

            VentiladorHighCommand highCommand = new VentiladorHighCommand(ventilador);

            VentiladorMediumCommand mediumCommand = new VentiladorMediumCommand(ventilador);

            VentiladorOffCommand offCommand = new VentiladorOffCommand(ventilador);

            remoteControl.SetCommand(0, mediumCommand, offCommand);
            remoteControl.SetCommand(1, highCommand, offCommand);

            remoteControl.OnButtonPushed(0);

            remoteControl.OffButtonPushed(0);

            remoteControl.UndoButtonWasPushed();

            remoteControl.OnButtonPushed(1);
            remoteControl.UndoButtonWasPushed();

            Console.Write(remoteControl.ToString());
        }
Example #2
0
 public void Execute()
 {
     PrevSpeed = Ventilador.Speed;
     Ventilador.Medium();
 }
Example #3
0
 public VentiladorMediumCommand(Ventilador ventilador)
 {
     Ventilador = ventilador;
 }
 public void Execute()
 {
     PrevSpeed = Ventilador.Speed;
     Ventilador.High();
 }
 public VentiladorHighCommand(Ventilador ventilador)
 {
     Ventilador = ventilador;
 }
 public VentiladorOffCommand(Ventilador ventilador)
 {
     Ventilador = ventilador;
 }