Beispiel #1
0
        static void Main(string[] args)
        {
            IMobilePhone nokiaMobilePhone = new Nokia();
            MobileClient nokiaClient      = new MobileClient(nokiaMobilePhone);

            Console.WriteLine("********* NOKIA **********");
            Console.WriteLine(nokiaClient.GetSmartPhoneModelDetails());
            Console.WriteLine(nokiaClient.GetNormalPhoneModelDetails());

            IMobilePhone samsungMobilePhone = new Samsung();
            MobileClient samsungClient      = new MobileClient(samsungMobilePhone);

            Console.WriteLine("******* SAMSUNG **********");
            Console.WriteLine(samsungClient.GetSmartPhoneModelDetails());
            Console.WriteLine(samsungClient.GetNormalPhoneModelDetails());

            IMobilePhone motoMobilePhone = new Moto();
            MobileClient motoClient      = new MobileClient(motoMobilePhone);

            Console.WriteLine("******* MOTO **********");
            //Console.WriteLine(motoClient.GetNormalPhoneModelDetails());
            Console.WriteLine(motoClient.GetSmartPhoneModelDetails());

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            IMobilePhone nokia       = new Nokia();
            MobileClient nokiaClient = new MobileClient(nokia);

            Console.WriteLine("*****************NOKIA********************");
            Console.WriteLine(nokiaClient.GetNormalPhoneDetails());
            Console.WriteLine(nokiaClient.GetSmartPhoneDetails());
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            ITelephoneFactory nokia   = new Nokia("Nokia");
            ITelephoneFactory samsung = new Samsung("Samsung");

            Console.WriteLine($"В фабрике {nokia.FactoryName()} -  {nokia.CreateAccumulator().AccumulatorModel()}, {nokia.CreateDisplay().DisplayModel()}");
            Console.WriteLine($"Тип аккумулятора {nokia.CreateDisplay().AccumulatorType()}");
            Console.WriteLine("******************************");
            Console.WriteLine($"В фабрике {samsung.FactoryName()} -  {samsung.CreateAccumulator().AccumulatorModel()}, {samsung.CreateDisplay().DisplayModel()}");
            Console.WriteLine($"Тип аккумулятора {samsung.CreateDisplay().AccumulatorType()}");
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            IMobilePhone mobilePhone = new Nokia();

            var nokiaClient = new Client(mobilePhone);

            Console.WriteLine(nokiaClient.GetOldPhone());
            Console.WriteLine(nokiaClient.GetSmartPhone());

            Console.Read();
        }