Пример #1
0
        public static void Main(string[] args)
        {
            IMobile      samsungMobilePhone = new Samsung();
            MobileClient samsungClient      = new MobileClient(samsungMobilePhone);

            Debug.WriteLine(samsungClient.GetAndroidPhoneDetails());
            Debug.WriteLine(samsungClient.GetiOSPhoneDetails());
        }
Пример #2
0
        public static Phone Create(int i)
        {
            Phone phone = null;

            switch (i)
            {
                case 11:
                    phone = new Mi();
                    break;
                case 12:
                    phone = new Samsung();
                    break;
                default:
                    phone = new Mi();
                    break;
            }

            return phone;
        }