Пример #1
0
        static void Main(string[] args)
        {
            TV    tv    = new TV(100, 2, true);
            Memir memir = new Memir(50, 5, true);

            RemoteControl remoteControl = new RemoteControl(tv);

            remoteControl.PrintState();
            remoteControl.Off();
            remoteControl.On();
            remoteControl.Previous();
            remoteControl.Next();
            remoteControl.Next();
            remoteControl.Next();
            remoteControl.PrintState();
            Console.WriteLine();

            remoteControl.SetDevice(memir);
            remoteControl.PrintState();
            remoteControl.Off();
            remoteControl.On();
            remoteControl.Previous();
            remoteControl.Next();
            remoteControl.Next();
            remoteControl.Next();
            remoteControl.PrintState();
            Console.WriteLine();
        }
Пример #2
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();
        }