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()); }
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()); }
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()); }
// 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()); }
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() ); }