protected PizzaIngredientFactory(IDough dough, ISauce sauce, IClams clams, ICheese cheese) { Dough = dough; Sauce = sauce; Clams = clams; Cheese = cheese; }
public Pizza( [Import(typeof(IDough))] IDough dough, [Import(typeof(ITopping))] ITopping topping) { this.Dough = dough; this.Topping = topping; }
public override void Prepare() { IDough dough = PizzaIngredientFactory.CreateDough(); ISauce sauce = PizzaIngredientFactory.CreateSauce(); Console.WriteLine("Preparing Pizza {0}, {1}", dough.Description, sauce.Description); }
public Pizza(IIngredientFactory ingredientFactory) { IngredientFactory = ingredientFactory; Dough = IngredientFactory.CreateDough(); Sauce = IngredientFactory.CreateSauce(); Meat = IngredientFactory.CreateMeat(); Veggie = IngredientFactory.CreateVeggie(); }
public virtual void Prepare() { Console.WriteLine("Preparing: " + _name); _dough = _ingredientFactory.CreateDough(); _sauce = _ingredientFactory.CreateSauce(); _cheese = _ingredientFactory.CreateCheese(); _clams = _ingredientFactory.CreateClam(); _pepperoni = _ingredientFactory.CreatePepperoni(); _veggies = _ingredientFactory.CreateVeggies(); }
internal void Prepare() { Console.Out.WriteLine(String.Format("Preparing {0}.", Name)); this.dough = pizzaIngredientFactory.CreateDough(); this.cheeses = pizzaIngredientFactory.CreateCheeses(); this.sauce = pizzaIngredientFactory.CreateSauce(); this.toppings = CreateToppings(); Console.Out.WriteLine("Tossing dough..."); Console.Out.WriteLine("Adding sauce ..."); Console.Out.WriteLine("Adding toppings: "); foreach(var topping in toppings) { Console.Out.WriteLine(String.Format(" {0}", topping)); } }
internal void Prepare() { Console.Out.WriteLine(String.Format("Preparing {0}.", Name)); this.dough = pizzaIngredientFactory.CreateDough(); this.cheeses = pizzaIngredientFactory.CreateCheeses(); this.sauce = pizzaIngredientFactory.CreateSauce(); this.toppings = CreateToppings(); Console.Out.WriteLine("Tossing dough..."); Console.Out.WriteLine("Adding sauce ..."); Console.Out.WriteLine("Adding toppings: "); foreach (var topping in toppings) { Console.Out.WriteLine(String.Format(" {0}", topping)); } }
static void Main(string[] args) { IPizzaIngredientFactory ingredientFactory = FactoryProvider.GetPizzaIngredientFactory("NY"); IDough dough = ingredientFactory.GetConcreteProduct <IDough>(); ISauce sauce = ingredientFactory.GetConcreteProduct <ISauce>(); ICheese cheese = ingredientFactory.GetConcreteProduct <ICheese>(); IVeggies veggies = ingredientFactory.GetConcreteProduct <IVeggies>(); IPepperoni pepperoni = ingredientFactory.GetConcreteProduct <IPepperoni>(); IClam clam = ingredientFactory.GetConcreteProduct <IClam>(); ingredientFactory.getStyle(); Console.WriteLine("Состав:"); dough.AboutMe(); sauce.AboutMe(); cheese.AboutMe(); veggies.AboutMe(); clam.AboutMe(); Console.WriteLine("\nЗаменим стиль\n"); ingredientFactory = FactoryProvider.GetPizzaIngredientFactory("Chicago"); dough = ingredientFactory.GetConcreteProduct <IDough>(); sauce = ingredientFactory.GetConcreteProduct <ISauce>(); cheese = ingredientFactory.GetConcreteProduct <ICheese>(); veggies = ingredientFactory.GetConcreteProduct <IVeggies>(); pepperoni = ingredientFactory.GetConcreteProduct <IPepperoni>(); clam = ingredientFactory.GetConcreteProduct <IClam>(); ingredientFactory.getStyle(); Console.WriteLine("Состав:"); dough.AboutMe(); sauce.AboutMe(); cheese.AboutMe(); veggies.AboutMe(); clam.AboutMe(); Console.ReadKey(); }
public WheatDough(IDough dough) { _dough = dough; }
public CinnamonDough(IDough dough) { _dough = dough; }