예제 #1
0
        private void PizzaStore_Load(object sender, EventArgs e)
        {
            SimplePizzaFactory pizzaFactory = new SimplePizzaFactory();

            _pizzaStore = new PizzaStoreClass(pizzaFactory);

            foreach (PizzaType pizza in (PizzaType[])Enum.GetValues(typeof(PizzaType)))
            {
                ListBoxPizza.Items.Add(pizza.ToString());
            }
        }
예제 #2
0
 public PizzaStore(SimplePizzaFactory pf)
 {
     factory = pf;
 }
예제 #3
0
 public PizzaStore(SimplePizzaFactory factory)
 {
     _factory = factory;
 }
예제 #4
0
 static void Main(string[] args)
 {
     SimplePizzaFactory factory    = new SimplePizzaFactory();
     PizzaStore         pizzaStore = new PizzaStore(factory);
     Pizza pizza = pizzaStore.OrderPizza("cheese");
 }
예제 #5
0
 public PizzaStore(SimplePizzaFactory factory)
 {
     this.factory = factory;
 }