/// <summary> /// Add item to order list /// </summary> /// <param name="sender">button</param> /// <param name="e">press</param> private void OrderItem(object sender, RoutedEventArgs e) { switch (StringGetter) { case "briarheartBurger": BriarheartBurger entree = new BriarheartBurger(); if (bun.IsChecked == true) { entree.Bun = false; } if (ketchup.IsChecked == true) { entree.Ketchup = false; } if (mustard.IsChecked == true) { entree.Mustard = false; } if (pickle.IsChecked == true) { entree.Pickle = false; } if (cheese.IsChecked == true) { entree.Cheese = false; } if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null) { (Application.Current.MainWindow as MainWindow).Combo.Entree = entree; } else { (Application.Current.MainWindow as MainWindow).curOrder.Add(entree); } return; case "doubleDraugr": DoubleDraugr draugr = new DoubleDraugr(); if (bun.IsChecked == true) { draugr.Bun = false; } if (ketchup.IsChecked == true) { draugr.Ketchup = false; } if (mustard.IsChecked == true) { draugr.Mustard = false; } if (pickle.IsChecked == true) { draugr.Pickle = false; } if (cheese.IsChecked == true) { draugr.Cheese = false; } if (tomato.IsChecked == true) { draugr.Tomato = false; } if (lettuce.IsChecked == true) { draugr.Lettuce = false; } if (mayo.IsChecked == true) { draugr.Mayo = false; } if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null) { (Application.Current.MainWindow as MainWindow).Combo.Entree = draugr; } else { (Application.Current.MainWindow as MainWindow).curOrder.Add(draugr); } return; case "gardenOrcOmelette": GardenOrcOmelette omellette = new GardenOrcOmelette(); if (broccoli.IsChecked == true) { omellette.Broccoli = false; } if (mushroom.IsChecked == true) { omellette.Mushrooms = false; } if (tomato.IsChecked == true) { omellette.Tomato = false; } if (cheddar.IsChecked == true) { omellette.Cheddar = false; } if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null) { (Application.Current.MainWindow as MainWindow).Combo.Entree = omellette; } else { (Application.Current.MainWindow as MainWindow).curOrder.Add(omellette); } return; case "phillyPoacher": PhillyPoacher philly = new PhillyPoacher(); if (sirloin.IsChecked == true) { philly.Sirloin = false; } if (onion.IsChecked == true) { philly.Onion = false; } if (roll.IsChecked == true) { philly.Roll = false; } if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null) { (Application.Current.MainWindow as MainWindow).Combo.Entree = philly; } else { (Application.Current.MainWindow as MainWindow).curOrder.Add(philly); } return; case "smokeHouseSkeleton": SmokehouseSkeleton house = new SmokehouseSkeleton(); if (hashBrowns.IsChecked == true) { house.HashBrowns = false; } if (sausage.IsChecked == true) { house.SausageLink = false; } if (pancakes.IsChecked == true) { house.Pancake = false; } if (eggs.IsChecked == true) { house.Egg = false; } if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null) { (Application.Current.MainWindow as MainWindow).Combo.Entree = house; } else { (Application.Current.MainWindow as MainWindow).curOrder.Add(house); } return; case "thalmorTriple": ThalmorTriple thalmor = new ThalmorTriple(); if (bun.IsChecked == true) { thalmor.Bun = false; } if (ketchup.IsChecked == true) { thalmor.Ketchup = false; } if (mustard.IsChecked == true) { thalmor.Mustard = false; } if (pickle.IsChecked == true) { thalmor.Pickle = false; } if (cheese.IsChecked == true) { thalmor.Cheese = false; } if (tomato.IsChecked == true) { thalmor.Tomato = false; } if (lettuce.IsChecked == true) { thalmor.Lettuce = false; } if (mayo.IsChecked == true) { thalmor.Mayo = false; } if (eggs.IsChecked == true) { thalmor.Egg = false; } if (bacon.IsChecked == true) { thalmor.Bacon = false; } if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null) { (Application.Current.MainWindow as MainWindow).Combo.Entree = thalmor; } else { (Application.Current.MainWindow as MainWindow).curOrder.Add(thalmor); } return; case "thugsTbone": ThugsTBone bone = new ThugsTBone(); if (Combo.IsChecked == true && (Application.Current.MainWindow as MainWindow).Combo.Entree == null) { (Application.Current.MainWindow as MainWindow).Combo.Entree = bone; } else { (Application.Current.MainWindow as MainWindow).curOrder.Add(bone); } return; } }
/// <summary> /// event handler that switches screens between home screen and item customization /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void onSwitchScreen(object sender, RoutedEventArgs e) { //if (DataContext is Order newOrder) //{ var buttons = (Button)sender; switch (buttons.ToString()) { case "System.Windows.Controls.Button: Briarheart Burger": BriarheartBurger newbb = new BriarheartBurger(); Ancestor.newOrder.Add(newbb); Ancestor.SwitchScreen(Screen.custBriarheartBurger, newbb); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Double Draugr": DoubleDraugr newdd = new DoubleDraugr(); Ancestor.newOrder.Add(newdd); Ancestor.SwitchScreen(Screen.custDoubleDraugr, newdd); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Garden Orc Omelette": GardenOrcOmelette newgoc = new GardenOrcOmelette(); Ancestor.newOrder.Add(newgoc); Ancestor.SwitchScreen(Screen.custGardenOrcOmelette, newgoc); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Philly Poacher": PhillyPoacher newpp = new PhillyPoacher(); Ancestor.newOrder.Add(newpp); Ancestor.SwitchScreen(Screen.custPhillyPoacher, newpp); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Smokehouse Skeleton": SmokehouseSkeleton newss = new SmokehouseSkeleton(); Ancestor.newOrder.Add(newss); Ancestor.SwitchScreen(Screen.custSmokehouseSkeleton, newss); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Thalmor Triple": ThalmorTriple newtt = new ThalmorTriple(); Ancestor.newOrder.Add(newtt); Ancestor.SwitchScreen(Screen.custThalmorTriple, newtt); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Dragonborn Waffle Fries": DragonbornWaffleFries newdwf = new DragonbornWaffleFries(); Ancestor.newOrder.Add(newdwf); Ancestor.SwitchScreen(Screen.custDragonbornWaffleFries, newdwf); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Fried Miraak": FriedMiraak newfm = new FriedMiraak(); Ancestor.newOrder.Add(newfm); Ancestor.SwitchScreen(Screen.custFriedMiraak, newfm); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Mad Otar Grits": MadOtarGrits newmog = new MadOtarGrits(); Ancestor.newOrder.Add(newmog); Ancestor.SwitchScreen(Screen.custMadOtarGrits, newmog); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Vokun Salad": VokunSalad newvs = new VokunSalad(); Ancestor.newOrder.Add(newvs); Ancestor.SwitchScreen(Screen.custVokunSalad, newvs); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Aretino Apple Juice": AretinoAppleJuice newaa = new AretinoAppleJuice(); Ancestor.newOrder.Add(newaa); Ancestor.SwitchScreen(Screen.custAretinoAppleJuice, newaa); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Candlehearth Coffee": CandlehearthCoffee newcc = new CandlehearthCoffee(); Ancestor.newOrder.Add(newcc); Ancestor.SwitchScreen(Screen.custCandlehearthCoffee, newcc); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Markarth Milk": MarkarthMilk newmm = new MarkarthMilk(); Ancestor.newOrder.Add(newmm); Ancestor.SwitchScreen(Screen.custMarkarthMilk, newmm); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Sailor Soda": SailorSoda newsoda = new SailorSoda(); Ancestor.newOrder.Add(newsoda); Ancestor.SwitchScreen(Screen.custSailorSoda, newsoda); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Warrior Water": WarriorWater newww = new WarriorWater(); Ancestor.newOrder.Add(newww); Ancestor.SwitchScreen(Screen.custWarriorWater, newww); DisplayCurrentOrder(); break; case "System.Windows.Controls.Button: Complete Order": Ancestor.SwitchScreen(Screen.completeOrder); break; } DisplayCurrentOrder(); //} }
/// <summary> /// Handles double draugr button click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void doubleDraugr_Click(object sender, RoutedEventArgs e) { DoubleDraugr d = new DoubleDraugr(parent, this, order); parent.containerBorder.Child = d; }
/// <summary> /// Draghaur click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void DoubleDraghaurClick(object sender, RoutedEventArgs e) { DoubleDraugr drau = new DoubleDraugr(); o.pageDisplay.Child = new CustomizationDrauger(o, drau); }
/// <summary> /// Override to create a menu to modify an existing item /// </summary> /// <param name="ancestor">Menu of which this is a child</param> /// <param name="item">Existing item to be modified</param> public DoubleDraugrMenu(MenuComponent ancestor, DoubleDraugr item) { InitializeComponent(); Ancestor = ancestor; this.DataContext = item; }
// Edit item click event handler private void EditItemClick(object sender, SelectionChangedEventArgs e) { if (OrderList.SelectedItem == null) { return; } DependencyObject parent = this; do { parent = LogicalTreeHelper.GetParent(parent); } while (!(parent is MainWindow || parent is null)); if (parent is MainWindow menu) { string itemString = OrderList.SelectedItem.ToString(); if (itemString.Contains("Briarheart Burger")) { BriarheartBurger item = e.AddedItems[0] as BriarheartBurger; if (DataContext is Order order) { var screen = new BriarheartBurgerCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Double Draugr")) { DoubleDraugr item = e.AddedItems[0] as DoubleDraugr; if (DataContext is Order order) { var screen = new DoubleDraugrCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Thalmor Triple")) { ThalmorTriple item = e.AddedItems[0] as ThalmorTriple; if (DataContext is Order order) { var screen = new ThalmorTripleCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Garden Orc Omelette")) { GardenOrcOmelette item = e.AddedItems[0] as GardenOrcOmelette; if (DataContext is Order order) { var screen = new GardenOrcOmeletteCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Philly Poacher")) { PhillyPoacher item = e.AddedItems[0] as PhillyPoacher; if (DataContext is Order order) { var screen = new PhillyPoacherCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Smokehouse Skeleton")) { SmokehouseSkeleton item = e.AddedItems[0] as SmokehouseSkeleton; if (DataContext is Order order) { var screen = new SmokehouseSkeletonCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Thugs T-Bone")) { ThugsTBone item = e.AddedItems[0] as ThugsTBone; if (DataContext is Order order) { var screen = new ThugsTBoneCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Dragonborn Waffle Fries")) { DragonbornWaffleFries item = e.AddedItems[0] as DragonbornWaffleFries; if (DataContext is Order order) { var screen = new DragonbornWaffleFriesCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Fried Miraak")) { FriedMiraak item = e.AddedItems[0] as FriedMiraak; if (DataContext is Order order) { var screen = new FriedMiraakCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Mad Otar Grits")) { MadOtarGrits item = e.AddedItems[0] as MadOtarGrits; if (DataContext is Order order) { var screen = new MadOtarGritsCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Vokun Salad")) { VokunSalad item = e.AddedItems[0] as VokunSalad; if (DataContext is Order order) { var screen = new VokunSaladCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Arentino Apple Juice")) { ArentinoAppleJuice item = e.AddedItems[0] as ArentinoAppleJuice; if (DataContext is Order order) { var screen = new ArentinoAppleJuiceCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Candlehearth Coffee")) { CandlehearthCoffee item = e.AddedItems[0] as CandlehearthCoffee; if (DataContext is Order order) { var screen = new CandlehearthCoffeeCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Markarth Milk")) { MarkarthMilk item = e.AddedItems[0] as MarkarthMilk; if (DataContext is Order order) { var screen = new MarkarthMilkCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Sailor Soda")) { SailorSoda item = e.AddedItems[0] as SailorSoda; if (DataContext is Order order) { var screen = new SailorSodaCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } if (itemString.Contains("Warrior Water")) { WarriorWater item = e.AddedItems[0] as WarriorWater; if (DataContext is Order order) { var screen = new WarriorWaterCustom(); screen.DataContext = item; menu.displayBorder.Child = screen; } } } }
/// <summary> /// Takes the button selection for a menu item and updates screen to that items customization menu /// </summary> /// <param name="sender">Button</param> /// <param name="e">Event</param> public void MenuButtonPress(object sender, RoutedEventArgs e) { if (DataContext is Order orderX) { var o = this.FindAncestor <OrderControl>(); IOrderItem choice; FrameworkElement display; switch ((sender as Button).Name) { case "burger": display = new BriarheartBurgerCustom(); choice = new BriarheartBurger(); break; case "draugr": display = new DoubleDraugrCustom(); choice = new DoubleDraugr(); break; case "triple": display = new ThalmorTripleCustom(); choice = new ThalmorTriple(); break; case "skeleton": display = new SmokehousrSkeletonCustom(); choice = new SmokehouseSkeleton(); break; case "omelette": display = new GardenOrcOmeletteCustom(); choice = new GardenOrcOmelette(); break; case "poacher": display = new PhillyPoacherCustom(); choice = new PhillyPoacher(); break; case "t_bone": display = new NoCustom(); choice = new ThugsTBone(); break; case "salad": SideCustom salad = new SideCustom(); salad.Title.Text = "Vokun Salad Customization"; display = salad; choice = new VokunSalad(); break; case "miraak": SideCustom miraak = new SideCustom(); miraak.Title.Text = "Fried Miraak Customization"; display = miraak; choice = new FriedMiraak(); break; case "grits": SideCustom grits = new SideCustom(); grits.Title.Text = "Mad Otar Grits Customization"; display = grits; choice = new MadOtarGrits(); break; case "fries": SideCustom fries = new SideCustom(); fries.Title.Text = "DragonBorn Waffle Fries Customization"; display = fries; choice = new DragonbornWaffleFries(); break; case "water": display = new WarriorWaterCustom(); choice = new WarriorWater(); break; case "soda": display = new SailorSodaCustom(); choice = new SailorSoda(); break; case "coffee": display = new CandlehearthCoffeeCustom(); choice = new CandlehearthCoffee(); break; case "milk": display = new MarkarthMilkCustom(); choice = new MarkarthMilk(); break; case "juice": display = new ArentinoAppleJuiceCustom(); choice = new AretinoAppleJuice(); break; case "ComboCreate": display = new ComboCustom(); choice = new Combo(); break; default: display = new MenuSelection(); choice = null; break; } display.DataContext = choice; choice.Display = display; o?.DisplayUpdate(display); } }