Пример #1
0
        static void Main(string[] args)
        {
            var bulb = new Bulb();

            var turnOn  = new TurnOn(bulb);
            var turnOff = new TurnOff(bulb);

            var remote = new RemoteControl();

            remote.Submit(turnOn);  // Bulb has been lit!
            remote.Submit(turnOff); // Darkness!

            Console.ReadLine();
        }
Пример #2
0
 public TurnOn(Bulb bulb)
 {
     mBulb = bulb ?? throw new ArgumentNullException("Bulb", "Bulb cannot be null");
 }