Esempio n. 1
0
        public override void RunApp()
        {
            IOutputWritter writter = new ConsoleWritter();
            ISmartPhone phone = new MySmartPhone(writter);
            IComputer computer = new MyHomeComputer(writter);

            phone.SwitchOn();
            phone.GoToInternet();
            phone.SwitchOff();

            computer.Hello();
            computer.RunBrowser();
            computer.SwitchOff();

            //now fun
            phone = new ComputerToPhoneAdapter((MyHomeComputer) computer);
            phone.SwitchOn();
            phone.GoToInternet();
            phone.SwitchOff();
        }
 public ComputerToPhoneAdapter(MyHomeComputer copm)
 {
     _copm = copm;
 }