Beispiel #1
0
        public IPhoneRecharger()
        {
            Console.WriteLine("---Recharging iPhone with iPhone Recharger---");
            var phone = new IPhone();

            phone.UseLightning();
            phone.Recharge();
            Console.WriteLine("---iPhone Ready for use---");
        }
Beispiel #2
0
        public MicroUsbRecharger()
        {
            Console.WriteLine("---Recharging iPhone with Generic Recharger---");
            var phone         = new IPhone();
            var iPhoneAdapter = new IPhoneAdapter(phone);

            iPhoneAdapter.UseMicroUsb();
            iPhoneAdapter.Recharge();
            Console.WriteLine("---iPhone Ready for use---");
        }
        static void Main(string[] args)
        {
            Android android = new Android();
            IPhone  iphone  = new IPhone();

            LightningToMicroUsbAdapter adapter = new LightningToMicroUsbAdapter(iphone);

            RechargeMicroUsbPhone(android);
            Console.WriteLine();
            RechargeLightningPhone(iphone);
            Console.WriteLine();
            RechargeMicroUsbPhone(adapter);

            Console.ReadKey();
        }