/// <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; }
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> /// Changes the usercontrol of the main menu contained within the ordercomponent /// </summary> /// <param name="customizer">a string describing the control to go to</param> public void changePrimaryMenu(string customizer) { switch (customizer) { case "Create A Combo": { PrimaryMenuBorder.Child = new ComboSelection(); ComboSelection c = PrimaryMenuBorder.Child as ComboSelection; c.DataContext = new Combo(); break; } case "Selection": { PrimaryMenuBorder.Child = new MenuSelectionComponent(); MenuSelectionComponent c = PrimaryMenuBorder.Child as MenuSelectionComponent; c.DataContext = null; break; } case "Briarheart Burger": { PrimaryMenuBorder.Child = new BriarheartBurgerCustomizer(); BriarheartBurgerCustomizer c = PrimaryMenuBorder.Child as BriarheartBurgerCustomizer; c.DataContext = new BriarheartBurger(); break; } case "Double Draugr": { PrimaryMenuBorder.Child = new DoubleDraugerCustomizer(); DoubleDraugerCustomizer c = PrimaryMenuBorder.Child as DoubleDraugerCustomizer; c.DataContext = new DoubleDraugr(); break; } case "Garden Orc Omelette": { PrimaryMenuBorder.Child = new GardenOrcOmeletteCustomizer(); GardenOrcOmeletteCustomizer c = PrimaryMenuBorder.Child as GardenOrcOmeletteCustomizer; c.DataContext = new GardenOrcOmelette(); break; } case "Philly Poacher": { PrimaryMenuBorder.Child = new PhillyPoacherCustomizer(); PhillyPoacherCustomizer c = PrimaryMenuBorder.Child as PhillyPoacherCustomizer; c.DataContext = new PhillyPoacher(); break; } case "Smokehouse Skeleton": { PrimaryMenuBorder.Child = new SmokehouseSkeletonCustomizer(); SmokehouseSkeletonCustomizer c = PrimaryMenuBorder.Child as SmokehouseSkeletonCustomizer; c.DataContext = new SmokehouseSkeleton(); break; } case "Thalmor Triple": { PrimaryMenuBorder.Child = new ThalmorTripleCustomizer(); ThalmorTripleCustomizer c = PrimaryMenuBorder.Child as ThalmorTripleCustomizer; c.DataContext = new ThalmorTriple(); break; } case "Thugs T-Bone": { PrimaryMenuBorder.Child = new MenuSelectionComponent(); MenuSelectionComponent c = PrimaryMenuBorder.Child as MenuSelectionComponent; c.DataContext = new ThugsTBone(); break; } case "Dragonborn Waffle Fries": { PrimaryMenuBorder.Child = new SideCustomizer(); SideCustomizer c = PrimaryMenuBorder.Child as SideCustomizer; c.DataContext = new DragonbornWaffleFries(); break; } case "Fried Miraak": { PrimaryMenuBorder.Child = new SideCustomizer(); SideCustomizer c = PrimaryMenuBorder.Child as SideCustomizer; c.DataContext = new FriedMiraak(); break; } case "Mad Otar Grits": { PrimaryMenuBorder.Child = new SideCustomizer(); SideCustomizer c = PrimaryMenuBorder.Child as SideCustomizer; c.DataContext = new MadOtarGrits(); break; } case "Vokun Salad": { PrimaryMenuBorder.Child = new SideCustomizer(); SideCustomizer c = PrimaryMenuBorder.Child as SideCustomizer; c.DataContext = new VokunSalad(); break; } case "Aretino Apple Juice": { PrimaryMenuBorder.Child = new AretinoAppleJuiceCustomizer(); AretinoAppleJuiceCustomizer c = PrimaryMenuBorder.Child as AretinoAppleJuiceCustomizer; c.DataContext = new AretinoAppleJuice(); break; } case "Candlehearth Coffee": { PrimaryMenuBorder.Child = new CandlehearthCoffeeCustomizer(); CandlehearthCoffeeCustomizer c = PrimaryMenuBorder.Child as CandlehearthCoffeeCustomizer; c.DataContext = new CandlehearthCoffee(); break; } case "Markarth Milk": { PrimaryMenuBorder.Child = new MarkarthMilkCustomizer(); MarkarthMilkCustomizer c = PrimaryMenuBorder.Child as MarkarthMilkCustomizer; c.DataContext = new MarkarthMilk(); break; } case "Warrior Water": { PrimaryMenuBorder.Child = new WarriorWaterCustomizer(); WarriorWaterCustomizer c = PrimaryMenuBorder.Child as WarriorWaterCustomizer; c.DataContext = new WarriorWater(); break; } case "Sailor Soda": { PrimaryMenuBorder.Child = new SailorSodaCustomizer(); SailorSodaCustomizer c = PrimaryMenuBorder.Child as SailorSodaCustomizer; c.DataContext = new SailorSoda(); break; } case null: break; } }