예제 #1
0
        static void Main()
        {
            var    analogPhone = new AnalogPhone();
            IPhone phone       = new AnalogPhoneAdapter(analogPhone);
            var    agent       = new CallAgent(phone);

            agent.CallNumber("0800123456");

            phone = new DigitalPhone();
            agent = new CallAgent(phone);
            agent.CallNumber("0800123456");

            Console.Read();
        }
예제 #2
0
        static void Main(string[] args)
        {
            ElectronicPhone myElPhone = new ElectronicPhone();

            myElPhone.Ring();

            TalkingPhone myTalkingPhone = new TalkingPhone();

            myTalkingPhone.Ring();

            DigitalPhone myDigitalPhone = new DigitalPhone();

            myDigitalPhone.Ring();
            myDigitalPhone.VoiceMail();

            DigitalCellPhone myDigitalCell = new DigitalCellPhone();

            myDigitalCell.Ring();
            myDigitalCell.VoiceMail();


            Console.ReadKey();
        }