Esempio 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();
        }
Esempio 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();
        }