Пример #1
0
        static void Main(string[] args)
        {
            EntertainmentDevice myTV    = new TV(100, 3, true);
            EntertainmentDevice myMemir = new Memir(50, 15, true);
            RemoteControl       control = new RemoteControl(myTV);

            control.PrintState();
            control.TurnOff();
            control.TurnOn();
            control.PressNext();
            control.PressPrevious();
            control.SetDevice(myMemir);
            control.PrintState();
            control.TurnOff();
            control.TurnOn();
            control.PressNext();
            control.PressPrevious();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var remoteControl = new RemoteControl(new SonyTV());

            remoteControl.TurnOn();
            remoteControl.TurnOff();

            var advancedRemoteControl = new AdvancedRemoteControl(new SamsungTV());

            advancedRemoteControl.TurnOn();
            advancedRemoteControl.TurnOff();
            advancedRemoteControl.SetChannel(1);

            Console.ReadKey();
        }
Пример #3
0
        static void Main(string[] args)
        {
            var remoteControl1 = new RemoteControl(new SamsungTv());

            remoteControl1.TurnOn();
            remoteControl1.TurnOff();

            var remoteControl2 = new AdvancedRemoteControl(new SonyTv());

            remoteControl2.TurnOn();
            remoteControl2.SetChannel(2);
            remoteControl2.TurnOff();

            Console.ReadLine();
        }