public void createThreeCustomizers(IOrderItem e, IOrderItem d, IOrderItem s) { List <Customizer> c = new List <Customizer>(); foreach (IOrderItem i in new List <IOrderItem> { e, d, s }) { if (i == null) { return; } Customizer customizer = null; if (i is BriarheartBurger) { customizer = new BriarheartBurgerCustomizer(); } if (i is DoubleDraugr) { customizer = new DoubleDraugerCustomizer(); } if (i is ThalmorTriple) { customizer = new ThalmorTripleCustomizer(); } if (i is GardenOrcOmelette) { customizer = new GardenOrcOmeletteCustomizer(); } if (i is PhillyPoacher) { customizer = new PhillyPoacherCustomizer(); } if (i is SmokehouseSkeleton) { customizer = new SmokehouseSkeletonCustomizer(); } if (i is DragonbornWaffleFries) { customizer = new SideCustomizer(); } if (i is FriedMiraak) { customizer = new SideCustomizer(); } if (i is MadOtarGrits) { customizer = new SideCustomizer(); } if (i is VokunSalad) { customizer = new SideCustomizer(); } if (i is AretinoAppleJuice) { customizer = new AretinoAppleJuiceCustomizer(); } if (i is CandlehearthCoffee) { customizer = new CandlehearthCoffeeCustomizer(); } if (i is MarkarthMilk) { customizer = new MarkarthMilkCustomizer(); } if (i is SailorSoda) { customizer = new SailorSodaCustomizer(); } if (i is WarriorWater) { customizer = new WarriorWaterCustomizer(); } if (customizer == null) { return; } customizer.DataContext = i; c.Add(customizer); } item1Border.Child = c[0]; item2Border.Child = c[1]; item3Border.Child = c[2]; item1Border.Child = c[0]; item2Border.Child = c[1]; item3Border.Child = c[2]; }
/// <summary> /// Turn the main window into the appropriate customization window. /// This means the DataContext of that customizer must be set to an existing IOrderItem. /// </summary> /// <param name="item"></param> public void EditCustomization(IOrderItem item) { if (item == null) { return; } Customizer customizer = null; if (item is BriarheartBurger) { customizer = new BriarheartBurgerCustomizer(); } if (item is DoubleDraugr) { customizer = new DoubleDraugerCustomizer(); } if (item is ThalmorTriple) { customizer = new ThalmorTripleCustomizer(); } if (item is GardenOrcOmelette) { customizer = new GardenOrcOmeletteCustomizer(); } if (item is PhillyPoacher) { customizer = new PhillyPoacherCustomizer(); } if (item is SmokehouseSkeleton) { customizer = new SmokehouseSkeletonCustomizer(); } if (item is DragonbornWaffleFries) { customizer = new SideCustomizer(); } if (item is FriedMiraak) { customizer = new SideCustomizer(); } if (item is MadOtarGrits) { customizer = new SideCustomizer(); } if (item is VokunSalad) { customizer = new SideCustomizer(); } if (item is AretinoAppleJuice) { customizer = new AretinoAppleJuiceCustomizer(); } if (item is CandlehearthCoffee) { customizer = new CandlehearthCoffeeCustomizer(); } if (item is MarkarthMilk) { customizer = new MarkarthMilkCustomizer(); } if (item is SailorSoda) { customizer = new SailorSodaCustomizer(); } if (item is WarriorWater) { customizer = new WarriorWaterCustomizer(); } if (item is Combo combo) { customizer = new ComboCustomizer(combo.Entree, combo.Drink, combo.Side); } if (item is null) { return; } PrimaryMenuBorder.Child = customizer; customizer.DataContext = item; }