public AbstractFactoryCilent() { AbstractFactory nanChangFactory = new NanChangFactory(); YaBo nanChangYabo = nanChangFactory.CreateYabo(); nanChangYabo.Print(); YaJia nanChangYajia = nanChangFactory.CreateYaJia(); nanChangYajia.Print(); AbstractFactory shangHaiFactory = new ShangHaiFactory(); YaBo shangHaiYabo = shangHaiFactory.CreateYabo(); shangHaiYabo.Print(); YaJia shangHaiYajia = shangHaiFactory.CreateYaJia(); shangHaiYajia.Print(); //新增湖南 AbstractFactory huNanFactory = new HuNanFactory(); YaBo huNanYabo = huNanFactory.CreateYabo(); huNanYabo.Print(); YaJia huNanYajia = huNanFactory.CreateYaJia(); huNanYajia.Print(); }
public void AbstractFactoryTest() { { AbstractFactory nanChangFactory = new NanChangFactory(); YaBo nanChangYabo = nanChangFactory.CreateYaBo(); nanChangYabo.Print(); YaJia nanChangYajia = nanChangFactory.CreateYaJia(); nanChangYajia.Print(); // 上海工厂制作上海的鸭脖和鸭架 AbstractFactory shangHaiFactory = new ShangHaiFactory(); shangHaiFactory.CreateYaBo().Print(); shangHaiFactory.CreateYaJia().Print(); } }
public void Test() { AbstractFactory nc = new NanChangFactory(); YaBo ncyb = nc.CreateYaBo(); ncyb.Print(); YaJia ncyj = nc.CreateYaJia(); ncyj.Print(); AbstractFactory sh = new ShangHaiFactory(); sh.CreateYaBo(); sh.CreateYaJia(); Console.ReadLine(); }
static void Main(string[] args) { // 南昌工厂制作南昌的鸭脖和鸭架 AbstractFactory nanChangFactory = new NanChangFactory(); YaBo nanChangYabo = nanChangFactory.CreateYaBo(); nanChangYabo.Print(); YaJia nanChangYajia = nanChangFactory.CreateYaJia(); nanChangYajia.Print(); // 上海工厂制作上海的鸭脖和鸭架 AbstractFactory shangHaiFactory = new ShangHaiFactory(); shangHaiFactory.CreateYaBo().Print(); shangHaiFactory.CreateYaJia().Print(); Console.Read(); }
private void button4_Click(object sender, EventArgs e) { // 南昌工厂制作南昌的鸭脖和鸭架 AbstractFactory nanChangFactory = new NanChangFactory(); YaBo nanChangYabo = nanChangFactory.CreateYaBo(); nanChangYabo.Print(); YaJia nanChangYajia = nanChangFactory.CreateYaJia(); nanChangYajia.Print(); // 上海工厂制作上海的鸭脖和鸭架 AbstractFactory shangHaiFactory = new ShangHaiFactory(); shangHaiFactory.CreateYaBo().Print(); shangHaiFactory.CreateYaJia().Print(); Console.Read(); }
static void Main(string[] args) { Console.WriteLine("南昌工厂创建及产品生产。"); AbstractFactory nanChangFactory = new NanChangFactory(); YaBo nanChangYabo = nanChangFactory.CreateYaBo(); nanChangYabo.Print(); YaJia nanChangYajia = nanChangFactory.CreateYaJia(); nanChangYajia.Print(); Console.WriteLine("————————————"); Console.WriteLine("山海工厂创建及产品生产。"); AbstractFactory shangHaiFactory = new ShangHaiFactory(); shangHaiFactory.CreateYaBo().Print(); shangHaiFactory.CreateYaJia().Print(); Console.Read(); }