Exemplo n.º 1
0
        public void Learn()
        {
            ComputerControl control = new ComputerControl();
            Computer computer = new Computer();

            ComputerOnCommand onCommand = new ComputerOnCommand(computer);
            ComputerOffCommand offCommand = new ComputerOffCommand(computer);

            control.SetCommand(onCommand, offCommand);

            control.PowerOn();
            control.PowerOff();
        }
Exemplo n.º 2
0
        public void Learn()
        {
            ComputerControl control  = new ComputerControl();
            Computer        computer = new Computer();

            ComputerOnCommand  onCommand  = new ComputerOnCommand(computer);
            ComputerOffCommand offCommand = new ComputerOffCommand(computer);

            control.SetCommand(onCommand, offCommand);

            control.PowerOn();
            control.PowerOff();
        }