public void TotClick(object sender, RoutedEventArgs args) { if (DataContext is Order order) { if (fromCombo) { CustomizeCombo c = new CustomizeCombo(); c.choseFries = false; c.choseTots = true; c.choseSticks = false; c.choseMac = false; c.CheckSide(); //NavigationService.Navigate(c); if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is CretaceousCombo combo) { Triceritots t = new Triceritots(); t.Size = combo.Size; combo.Side = t; } NavigationService.GoBack(); } else { order.Items.Add(new Triceritots()); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); } } }
/// <summary> /// This method is the click event for the sodasaurus button and adjusts buttons and bool values accordingly. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void SodasaurusClick(object sender, RoutedEventArgs args) { if (DataContext is Order order) { if (fromCombo) { CustomizeCombo c = new CustomizeCombo(); c.CheckDrink(); if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is CretaceousCombo combo) { Sodasaurus t = new Sodasaurus(); t.Size = combo.Size; combo.Drink = t; } } else { order.Items.Add(new Sodasaurus()); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); } } addLemonButton.Visibility = Visibility.Collapsed; creamButton.Visibility = Visibility.Collapsed; decafButton.Visibility = Visibility.Collapsed; sweetButton.Visibility = Visibility.Collapsed; flavorButton.Visibility = Visibility.Visible; }
/// <summary> /// Creates a new drink selection page /// </summary> /// <param name="drink">The saved drink</param> /// <param name="isCombo">If it's a combo</param> /// <param name="comboPage">The customize combo page</param> public DrinkSelection(Drink drink, bool isCombo, CustomizeCombo comboPage) { InitializeComponent(); this.isCombo = isCombo; this.comboPage = comboPage; if (this.isCombo) { this.comboPage.Combo.Drink = drink; Drink = comboPage.Combo.Drink; } else { Drink = drink; } holdIceButton.Content = "Hold ice"; holdIceButton.FontSize = 16; holdIceButton.Click += new RoutedEventHandler(OnHoldIce); iceButton.Content = "Add ice"; iceButton.FontSize = 16; iceButton.Click += new RoutedEventHandler(OnAddIce); flavorButton.Content = "Select flavor"; flavorButton.FontSize = 16; flavorButton.Click += new RoutedEventHandler(SelectFlavor); sweetButton.Content = "Add sweetener"; sweetButton.FontSize = 16; sweetButton.Click += new RoutedEventHandler(OnMakeSweet); lemonButton.Content = "Add lemon"; lemonButton.FontSize = 16; lemonButton.Click += new RoutedEventHandler(OnAddLemon); decafButton.Content = "Make decaf"; decafButton.FontSize = 16; decafButton.Click += new RoutedEventHandler(OnMakeDecaf); creamButton.Content = "Leave room for cream"; creamButton.FontSize = 16; creamButton.Click += new RoutedEventHandler(OnLeaveRoomForCream); if (drink is Sodasaurus soda) { ChangeSpecialButtonsSodasaurus(soda, new RoutedEventArgs()); } else if (drink is Tyrannotea tea) { ChangeSpecialButtonsTyrannotea(tea, new RoutedEventArgs()); } else if (drink is JurassicJava java) { ChangeSpecialButtonsJurassicJava(java, new RoutedEventArgs()); } else if (drink is Water water) { ChangeSpecialButtonsWater(water, new RoutedEventArgs()); } }
/// <summary> /// Creates a new customize entree page /// </summary> /// <param name="burger">The current SteakosaurusBurger</param> /// <param name="comboPage">The customize combo page</param> public CustomizeSteakosaurusBurger(SteakosaurusBurger burger, CustomizeCombo comboPage) { InitializeComponent(); isCombo = true; this.comboPage = comboPage; this.comboPage.Combo.Entree = burger; this.burger = (SteakosaurusBurger)comboPage.Combo.Entree; }
/// <summary> /// Creates a new customize entree page /// </summary> /// <param name="dino">The current dinonugget</param> /// <param name="comboPage">The customize combo page</param> public CustomizeDinoNuggets(DinoNuggets dino, CustomizeCombo comboPage) { InitializeComponent(); isCombo = true; this.comboPage = comboPage; this.comboPage.Combo.Entree = dino; this.dino = (DinoNuggets)comboPage.Combo.Entree; }
public void AddTriceritots(object sender, RoutedEventArgs args) { CustomizeCombo combo = new CustomizeCombo(); SelectSide(new Triceritots()); combo.Side.Content = "Triceritots"; }
/// <summary> /// Creates a new customize entree page /// </summary> /// <param name="bronto">The current brontowurst</param> /// <param name="comboPage">The customize combo page</param> public CustomizeBrontowurst(Brontowurst bronto, CustomizeCombo comboPage) { InitializeComponent(); isCombo = true; this.comboPage = comboPage; this.comboPage.Combo.Entree = bronto; this.bronto = (Brontowurst)comboPage.Combo.Entree; }
/// <summary> /// Creates a new customize entree page /// </summary> /// <param name="wrap">The current VelociWrap</param> /// <param name="comboPage">The customize combo page</param> public CustomizeVelociWrap(VelociWrap wrap, CustomizeCombo comboPage) { InitializeComponent(); isCombo = true; this.comboPage = comboPage; this.comboPage.Combo.Entree = wrap; this.wrap = (VelociWrap)comboPage.Combo.Entree; }
/// <summary> /// Creates a new customize entree page /// </summary> /// <param name="burger">The current TRexKingBurger</param> /// <param name="comboPage">The customize combo page</param> public CustomizeTRexKingBurger(TRexKingBurger burger, CustomizeCombo comboPage) { InitializeComponent(); isCombo = true; this.comboPage = comboPage; this.comboPage.Combo.Entree = burger; this.burger = (TRexKingBurger)comboPage.Combo.Entree; }
/// <summary> /// Creates a new customize entree page /// </summary> /// <param name="pbj">The current PrehistoricPBJ</param> /// <param name="comboPage">The customize combo page</param> public CustomizePrehistoricPBJ(PrehistoricPBJ pbj, CustomizeCombo comboPage) { InitializeComponent(); isCombo = true; this.comboPage = comboPage; this.comboPage.Combo.Entree = pbj; this.pbj = (PrehistoricPBJ)comboPage.Combo.Entree; }
public void AddFryceritops(object sender, RoutedEventArgs args) { CustomizeCombo combo = new CustomizeCombo(); SelectSide(new Fryceritops()); if (NavigationService.CanGoBack == true && NavigationService.Content == new CustomizeCombo()) { combo.Side.Content = "Fryceritops"; } }
private void comboButton_Click(object sender, RoutedEventArgs e) { Order ord; ord = (Order)parent.DataContext; CustomizeCombo custcombo = new CustomizeCombo(parent, new Combo()); parent.menuBorder.Child = custcombo; ord.Add((IOrderItem)custcombo.DataContext); }
/// <summary> /// Navigates to either the menu category selection page or the combo being created (if applicable) /// </summary> /// <param name="sender">The OnDone button.</param> /// <param name="e">Arguments</param> private void OnDone(object sender, RoutedEventArgs e) { if (isForComobo) { CustomizeCombo cc = new CustomizeCombo(entree); cc.DataContext = this.DataContext; cc.CreateCombo(entree); NavigationService.Navigate(cc); } else { NavigationService.Navigate(new MenuCategorySelection()); } }
/// <summary> /// constructor used by combo pages /// </summary> /// <param name="side"></param> /// <param name="isPartOfCombo"></param> /// <param name="comboPage"></param> public SideSelection(Side side, bool isPartOfCombo, CustomizeCombo comboPage) { InitializeComponent(); this.isPartOfCombo = isPartOfCombo; this.customizeComboPage = comboPage; if (this.isPartOfCombo) { this.customizeComboPage.Combo.Side = side; Side = customizeComboPage.Combo.Side; } else { Side = side; } }
/// <summary> /// 3 arg construcot /// </summary> public DrinkSelection(Drink drink, bool combo, CustomizeCombo comboPage) { InitializeComponent(); this.isPartOfCombo = combo; this.customizeComboPage = comboPage; if (this.isPartOfCombo) { this.customizeComboPage.Combo.Drink = drink; Drink = customizeComboPage.Combo.Drink; } if (drink is Sodasaurus) { Lemon.IsEnabled = false; decaf.IsEnabled = false; Flavor.IsEnabled = true; sweet.IsEnabled = false; Ice.IsEnabled = true; Cream.IsEnabled = false; } else if (drink is Tyrannotea) { Lemon.IsEnabled = true; decaf.IsEnabled = false; Flavor.IsEnabled = true; sweet.IsEnabled = true; Ice.IsEnabled = true; Cream.IsEnabled = false; } else if (drink is JurassicJava) { Lemon.IsEnabled = false; decaf.IsEnabled = true; Flavor.IsEnabled = false; sweet.IsEnabled = true; Ice.IsEnabled = true; Cream.IsEnabled = true; } else if (drink is Water) { Lemon.IsEnabled = true; decaf.IsEnabled = false; Flavor.IsEnabled = false; sweet.IsEnabled = false; Ice.IsEnabled = true; Cream.IsEnabled = false; } }
/// <summary> /// Handles what happens when a combo button is clicked. /// </summary> /// <param name="sender">The object being clicked.</param> /// <param name="args">The RoutedEventArgs.</param> private void ComboClick(object sender, RoutedEventArgs e) { Entree entree = new SteakosaurusBurger(); string entreeName = (string)((Button)sender).Tag; switch (entreeName) { case "Brontowurst": entree = new Brontowurst(); break; case "Steakosaurus": entree = new SteakosaurusBurger(); break; case "T-Rex": entree = new TRexKingBurger(); break; case "Prehistoric": entree = new PrehistoricPBJ(); break; case "Pterodactyl": entree = new PterodactylWings(); break; case "Veloci-Wrap": entree = new VelociWrap(); break; case "Dino-Nuggets": entree = new DinoNuggets(); break; } if (DataContext is Order order) { order.Add(new CretaceousCombo(entree)); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); CustomizeCombo page = new CustomizeCombo(); page.SetCombo((CretaceousCombo)order.Items.Last <IOrderItem>()); NavigationService.Navigate(page); } }
/// <summary> /// This method is the click event for the water button and adjusts buttons and bool values accordingly. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void WaterClick(object sender, RoutedEventArgs args) { if (DataContext is Order order) { order.Items.Add(new Water()); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); if (fromCombo) { CustomizeCombo c = new CustomizeCombo(); c.CheckDrink(); if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is CretaceousCombo combo) { Water t = new Water(); t.Size = combo.Size; combo.Drink = t; } } else { order.Items.Add(new Water()); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); } } addLemonButton.Visibility = Visibility.Visible; creamButton.Visibility = Visibility.Collapsed; decafButton.Visibility = Visibility.Collapsed; sweetButton.Visibility = Visibility.Collapsed; flavorButton.Visibility = Visibility.Collapsed; /*if (fromCombo) * { * CustomizeCombo c = new CustomizeCombo(); * c.choseTea = false; * c.choseWater = true; * c.choseSoda = false; * c.choseCoffee = false; * c.CheckDrink(); * NavigationService.Navigate(c); * }*/ }
/// <summary> /// This method is the click event for when the user clicks on a combo that navigates them to the combo customization page afterward. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void ComboClick(object sender, RoutedEventArgs args) { if (DataContext is Order order) { Entree e = new Brontowurst(); CustomizeCombo c = new CustomizeCombo(); if (sender == BratButton) { e = new Brontowurst(); } else if (sender == NuggetButton) { e = new DinoNuggets(); } else if (sender == SteakButton) { e = new SteakosaurusBurger(); } else if (sender == TRexButton) { e = new TRexKingBurger(); } else if (sender == WrapButton) { e = new VelociWrap(); } else if (sender == WingButton) { e = new PterodactylWings(); } else if (sender == PBJButton) { e = new PrehistoricPBJ(); } order.Add(new CretaceousCombo(e)); CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast(); //c.SetCombo(CretaceousCombo)order.Items.Last<IOrderItem>()); NavigationService.Navigate(c); } }
/// <summary> /// Event handler for selecting an entree /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void EntreeSelected(object sender, RoutedEventArgs args) { Button button = (Button)sender; string entreeText = (string)button.Tag; Entree entree; switch (entreeText) { case "Brontowurst Combo": entree = new Brontowurst(); break; case "Dino-Nuggets Combo": entree = new DinoNuggets(); break; case "Steakosaurus Burger Combo": entree = new SteakosaurusBurger(); break; case "T-Rex King Burger Combo": entree = new TRexKingBurger(); break; case "Pterodactyl Wings Combo": entree = new PterodactylWings(); break; case "Prehistoric PB&J Combo": entree = new PrehistoricPBJ(); break; default: entree = new VelociWrap(); break; } CustomizeCombo comboScreen = new CustomizeCombo(entree); NavigationService.Navigate(comboScreen); }
/// <summary> /// Constructs the drink selection page given a combo page /// </summary> /// <param name="C">The combo page that this drink selection page was constructed from</param> public DrinkSelection(CustomizeCombo C) { InitializeComponent(); c = C; }
/// <summary> /// Determines what happens when the selected object is changed. /// </summary> /// <param name="sender">The ListBox that is being updated.</param> /// <param name="e">The SelectionChagedEventArgs of the selection change.</param> public void SelectionChange(object sender, SelectionChangedEventArgs e) { ListBox buff = sender as ListBox; if (selectedItem != null) { if (uxListBox != buff) { uxListBox.SelectedItem = null; } } uxListBox = buff; if (e.AddedItems.Count > 0) { selectedItem = e.AddedItems[0] as IOrderItem; } if (selectedItem != lastSelectedItem) { if (selectedItem is Entree entree) { //Console.WriteLine("Selected an entree"); CustomizeEntree page = new CustomizeEntree(); page.InitPage(entree, new MenuCategorySelection()); page.SetEditedEntree(entree); MainWindow window = Window.GetWindow(this) as MainWindow; window.GetCurrentPage().NavigationService.Navigate(page); } else if (selectedItem is Side side) { //Console.WriteLine("Selected a side"); SideSelection page = new SideSelection(); page.SetEditedSide(side, new MenuCategorySelection()); MainWindow window = Window.GetWindow(this) as MainWindow; window.GetCurrentPage().NavigationService.Navigate(page); } else if (selectedItem is Drink drink) { //Console.WriteLine("Selected a drink"); DrinkSelection page = new DrinkSelection(); page.SetReturnPage(new MenuCategorySelection()); page.SetEditedDrink(drink); MainWindow window = Window.GetWindow(this) as MainWindow; window.GetCurrentPage().NavigationService.Navigate(page); } else if (selectedItem is CretaceousCombo combo) { //Console.WriteLine("Selected a combo"); CustomizeCombo page = new CustomizeCombo(); page.SetReturnPage(new MenuCategorySelection()); Console.WriteLine("Combo size: " + combo.Size); page.SetCombo(combo); MainWindow window = Window.GetWindow(this) as MainWindow; window.GetCurrentPage().NavigationService.Navigate(page); } } lastSelectedItem = selectedItem; }
/// <summary> /// Used to reopen customization screen for any type of IOrderItem /// </summary> /// <param name="sender">used for selection event</param> /// <param name="e">used for selection event</param> private void itemsListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { IOrderItem curItem = (IOrderItem)itemsListView.SelectedItem; if (curItem is BriarheartBurger bb) { CustomizeBriarheartBurger cbb = new CustomizeBriarheartBurger(this, bb); menuBorder.Child = cbb; } else if (curItem is DoubleDraugr dd) { CustomizeDoubleDraugr cdd = new CustomizeDoubleDraugr(this, dd); menuBorder.Child = cdd; } else if (curItem is GardenOrcOmelette gorc) { CustomizeGardenOrcOmelette cgorc = new CustomizeGardenOrcOmelette(this, gorc); menuBorder.Child = cgorc; } else if (curItem is PhillyPoacher pp) { CustomizePhillyPoacher cpp = new CustomizePhillyPoacher(this, pp); menuBorder.Child = cpp; } else if (curItem is SmokehouseSkeleton ss) { CustomizeSmokehouseSkeleton css = new CustomizeSmokehouseSkeleton(this, ss); menuBorder.Child = css; } else if (curItem is ThalmorTriple tt) { CustomizeThalmorTriple ctt = new CustomizeThalmorTriple(this, tt); menuBorder.Child = ctt; } else if (curItem is ThugsTBone thugst) { CustomizeThugsTBone cthugst = new CustomizeThugsTBone(this, thugst); menuBorder.Child = cthugst; } else if (curItem is AretinoAppleJuice aj) { CustomizeAretinoAppleJuice caj = new CustomizeAretinoAppleJuice(this, aj); menuBorder.Child = caj; } else if (curItem is CandlehearthCoffee cc) { CustomizeCandlehearthCoffee ccc = new CustomizeCandlehearthCoffee(this, cc); menuBorder.Child = ccc; } else if (curItem is MarkarthMilk mm) { CustomizeMarkarthMilk cmm = new CustomizeMarkarthMilk(this, mm); menuBorder.Child = cmm; } else if (curItem is SailorSoda sails) { CustomizeSailorSoda csails = new CustomizeSailorSoda(this, sails); menuBorder.Child = csails; } else if (curItem is WarriorWater ww) { CustomizeWarriorWater cww = new CustomizeWarriorWater(this, ww); menuBorder.Child = cww; } else if (curItem is DragonbornWaffleFries wf) { CustomizeDragonbornWaffleFries cwf = new CustomizeDragonbornWaffleFries(this, wf); menuBorder.Child = cwf; } else if (curItem is FriedMiraak fm) { CustomizeFriedMiraak cfm = new CustomizeFriedMiraak(this, fm); menuBorder.Child = cfm; } else if (curItem is MadOtarGrits mad) { CustomizeMadOtarGrits cmad = new CustomizeMadOtarGrits(this, mad); menuBorder.Child = cmad; } else if (curItem is VokunSalad vs) { CustomizeVokunSalad cvs = new CustomizeVokunSalad(this, vs); menuBorder.Child = cvs; } else if (curItem is Combo cmb) { CustomizeCombo ccmb = new CustomizeCombo(this, cmb); menuBorder.Child = ccmb; } }
public SideSelection(CustomizeCombo c) { InitializeComponent(); this.c = c; }