Пример #1
0
        static void Main(string[] args)
        {
            var bulb       = new Bulb();
            var controller = new RemoteController
            {
                OnCommand  = new LightOnCommand(bulb),
                OffCommand = new LightOffCommand(bulb)
            };

            controller.PressOnButton();
            controller.PressOffButton();
        }
Пример #2
0
 public LightOffCommand(Bulb bulb)
 {
     _bulb = bulb;
 }