static void Main(string[] args) { JuewWeiFactory shFactory = new ShangHaiFactory(); shFactory.CreateYaBo(); shFactory.CreateYaJia(); JuewWeiFactory scFactory = new SiChuanFactory(); scFactory.CreateYaBo(); scFactory.CreateYaJia(); DeviceFactory americanFactory = new AmericanFactory(); americanFactory.CreateComputer(); americanFactory.CreatePhone(); DeviceFactory chinaFactory = new ChinaFactory(); chinaFactory.CreateComputer(); chinaFactory.CreatePhone(); Console.ReadKey(); }
public static void UseAmericaItems() { AbstractFactory factory = new AmericanFactory(); PrintNames(factory); }