コード例 #1
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();
        }
コード例 #2
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();
        }