Пример #1
0
        public void CheckProducts() // This method is called to new up the correct class
        {
            switch (manu)
            {
            case MANUFACTURERS.SAMSUNG:
                factory = new SamsungFactory();
                break;

            case MANUFACTURERS.HTC:
                factory = new HTCFactory();
                break;

            case MANUFACTURERS.NOKIA:
                factory = new NokiaFactory();
                break;
            }

            Console.WriteLine(manu.ToString() + ":\nSmart Phone: " + factory.GetSmart().Name() + "\nDumb Phone: " + factory.GetDumb().Name());
        }
Пример #2
0
        public void CheckProducts()
        {
            switch (manu)
            {
            case MANUFACTURERS.KING:
                factory = new HPFactory();
                break;

            case MANUFACTURERS.LINKS:
                factory = new AsusFactory();
                break;

            case MANUFACTURERS.MSAN:
                factory = new ToshibaFactory();
                break;
            }

            Console.WriteLine("Retailer: " + manu.ToString() + ":\nMmanufacturer: " + factory.GetPCType().PCName() + "\nDisplay: " + factory.GetMonitorType().MName());
        }
Пример #3
0
            public void CheckProducts()
            {
                switch (manu)
                {
                case MANUFACTURERS.SAMSUNG:
                    factory = new SamsungFactory();
                    break;

                case MANUFACTURERS.HTC:
                    factory = new HTCFactory();
                    break;

                case MANUFACTURERS.IPHONE:
                    factory = new iPhoneFactory();
                    break;
                }

                Console.WriteLine(manu.ToString() + ":\nSmart Phone: " +
                                  factory.GetSmart().Name() + "\nDumb Phone: " + factory.GetDumb().Name());
            }
Пример #4
0
        // Check phone brands, write to console
        public void CheckProducts()
        {
            // Set internal factory to correct factory
            if (manu == MANUFACTURERS.SAMSUNG)
            {
                factory = new SamsungFactory();
            }
            else if (manu == MANUFACTURERS.HTC)
            {
                factory = new HTCFactory();
            }
            else if (manu == MANUFACTURERS.NOKIA)
            {
                factory = new NokiaFactory();
            }

            // Write phone types to console
            Console.WriteLine(manu.ToString());
            Console.WriteLine("Smartphone: " + factory.GetSmart().getName());
            Console.WriteLine("Dumbphone: " + factory.GetDumb().getName());
        }
Пример #5
0
        public void CheckProducts()
        {
            switch (manu)
            {
            case MANUFACTURERS.ManufacturerOne:
                factory = new ManufacturerOneFactory();
                break;

            case MANUFACTURERS.ManufacturerTwo:
                factory = new ManufacturerTwoFactory();
                break;

            case MANUFACTURERS.ManufacturerThree:
                factory = new ManufacturerThreeFactory();
                break;
            }


            Console.WriteLine(manu.ToString() + ":\nFirst Product: " +
                              factory.GetFirst().Name() + "\nLeast Product: " +
                              factory.GetLeast().Name()
                              );
        }