diff --git a/PointOfSale/CustomizeCombo.xaml.cs b/PointOfSale/CustomizeCombo.xaml.cs index 7a33ba52..fab0ec41 100644 --- a/PointOfSale/CustomizeCombo.xaml.cs +++ b/PointOfSale/CustomizeCombo.xaml.cs @@ -25,7 +25,7 @@ namespace PointOfSale /// public partial class CustomizeCombo : Page { - public CretaceousCombo Combo { get; private set; } + private CretaceousCombo combo; /// /// Initialize the CustomizeCombo page. @@ -34,9 +34,9 @@ public partial class CustomizeCombo : Page public CustomizeCombo(Entree entree) { InitializeComponent(); - Combo = new CretaceousCombo(entree); - DrinkChoice.Text = Combo.Drink.ToString(); - SideChoice.Text = Combo.Side.ToString(); + combo = new CretaceousCombo(entree); + DrinkChoice.Text = combo.Drink.ToString(); + SideChoice.Text = combo.Side.ToString(); } /// @@ -46,7 +46,7 @@ public CustomizeCombo(Entree entree) /// private void SelectSide(object sender, RoutedEventArgs args) { - NavigationService.Navigate(new SideSelection()); + NavigationService.Navigate(new SideSelection(combo.Side)); } /// @@ -56,7 +56,7 @@ private void SelectSide(object sender, RoutedEventArgs args) /// private void SelectDrink(object sender, RoutedEventArgs args) { - NavigationService.Navigate(new DrinkSelection()); + NavigationService.Navigate(new DrinkSelection(combo.Drink)); } /// @@ -66,10 +66,9 @@ private void SelectDrink(object sender, RoutedEventArgs args) /// private void SelectSmall(object sender, RoutedEventArgs args) { - Combo.Size = DinoDiner.Menu.Size.Small; + ClearButtonValues(); + combo.Size = DinoDiner.Menu.Size.Small; SmallButton.Background = Brushes.LightGreen; - MediumButton.ClearValue(Control.BackgroundProperty); - LargeButton.ClearValue(Control.BackgroundProperty); } /// @@ -79,10 +78,9 @@ private void SelectSmall(object sender, RoutedEventArgs args) /// private void SelectMedium(object sender, RoutedEventArgs args) { - Combo.Size = DinoDiner.Menu.Size.Medium; - SmallButton.ClearValue(Control.BackgroundProperty); + ClearButtonValues(); + combo.Size = DinoDiner.Menu.Size.Medium; MediumButton.Background = Brushes.LightGreen; - LargeButton.ClearValue(Control.BackgroundProperty); } /// @@ -92,10 +90,18 @@ private void SelectMedium(object sender, RoutedEventArgs args) /// private void SelectLarge(object sender, RoutedEventArgs args) { - Combo.Size = DinoDiner.Menu.Size.Large; + ClearButtonValues(); + combo.Size = DinoDiner.Menu.Size.Large; + LargeButton.Background = Brushes.LightGreen; + } + /// + /// Resets the button values. + /// + private void ClearButtonValues() + { SmallButton.ClearValue(Control.BackgroundProperty); MediumButton.ClearValue(Control.BackgroundProperty); - LargeButton.Background = Brushes.LightGreen; + LargeButton.ClearValue(Control.BackgroundProperty); } } } diff --git a/PointOfSale/DrinkSelection.xaml.cs b/PointOfSale/DrinkSelection.xaml.cs index b3357d92..1b8c213a 100644 --- a/PointOfSale/DrinkSelection.xaml.cs +++ b/PointOfSale/DrinkSelection.xaml.cs @@ -42,7 +42,6 @@ public DrinkSelection() } /// /// Initializes the DrinkSelection page. - /// Allows for a drink to be passed in. /// /// public DrinkSelection(Drink currentDrink) @@ -77,8 +76,6 @@ private void SelectCancel(object sender, RoutedEventArgs args) } /// /// Sets the drink to Water. - /// Disables Decaf/Sweet/Flavor buttons. - /// Enables the lemon button. /// /// /// @@ -92,8 +89,6 @@ private void SelectWater(object sender, RoutedEventArgs args) } /// /// Sets the drink to sodasaurus. - /// Enables the flavor button. - /// Disables the lemon button. /// /// /// @@ -108,8 +103,6 @@ private void SelectSodasaurus(object sender, RoutedEventArgs args) /// /// Sets the drink to tyrannotea. - /// Enables the sweet button. - /// Enables the lemon button. /// /// /// @@ -124,8 +117,6 @@ private void SelectTyrannotea(object sender, RoutedEventArgs args) /// /// Sets the drink to Jurrasic Java. - /// Enables the Decaf button. - /// Disables the lemon button. /// /// /// @@ -150,14 +141,13 @@ private void SelectFlavor(object sender, RoutedEventArgs args) } } /// - /// Adds or removes sweet. + /// Determines whether the tea is sweet. /// /// /// private void SelectSweet(object sender, RoutedEventArgs args) { - Tyrannotea tea = drink as Tyrannotea; - if (tea != null) + if (drink is Tyrannotea tea) { if (tea.Sweet) { @@ -307,7 +297,7 @@ private void SelectLarge(object sender, RoutedEventArgs args) LargeButton.Background = buttonColor; } /// - /// Sets the correct button properties and visibilities. + /// Prepares the DrinkSelection user interface. /// private void SetUpDrinkSelection() { @@ -386,7 +376,7 @@ private void SetUpDrinkSelection() } } /// - /// Clears the border values of all buttons. + /// Resets the button values. /// private void ClearButtonValues() { @@ -411,7 +401,7 @@ private void ClearButtonValues() IceButton.ClearValue(Control.BackgroundProperty); } /// - /// Disables property buttons. + /// Hides and disables property buttons. /// Enables size buttons. /// private void HideAndDisableAndEnableButtons() diff --git a/PointOfSale/EntreeSelection.xaml.cs b/PointOfSale/EntreeSelection.xaml.cs index 90b48c83..b7c928e1 100644 --- a/PointOfSale/EntreeSelection.xaml.cs +++ b/PointOfSale/EntreeSelection.xaml.cs @@ -29,7 +29,9 @@ public partial class EntreeSelection : Page private Brush buttonColor = Brushes.LightGreen; private Thickness buttonBorderThickness = new Thickness(2.5); - + /// + /// Initialize the EntreeSelection page. + /// public EntreeSelection() { InitializeComponent(); @@ -60,7 +62,7 @@ private void SelectCancel(object sender, RoutedEventArgs args) NavigationService.Navigate(new MenuCategorySelection()); } /// - /// Selects the brontowurst as the entree. + /// Selects brontowurst as the entree. /// /// /// @@ -71,7 +73,7 @@ private void SelectBrontowurst(object sender, RoutedEventArgs args) } /// - /// Selects the brontowurst as the entree. + /// Selects dino-nuggets as the entree. /// /// /// @@ -82,7 +84,7 @@ private void SelectDinoNuggets(object sender, RoutedEventArgs args) } /// - /// Selects the brontowurst as the entree. + /// Selects prehistoric pb&j as the entree. /// /// /// @@ -93,7 +95,7 @@ private void SelectPrehistoricPBJ(object sender, RoutedEventArgs args) } /// - /// Selects the brontowurst as the entree. + /// Selects pterodactyl wings as the entree. /// /// /// @@ -104,7 +106,7 @@ private void SelectPterodactylWings(object sender, RoutedEventArgs args) } /// - /// Selects the brontowurst as the entree. + /// Selects steakosaurus burger as the entree. /// /// /// @@ -115,7 +117,7 @@ private void SelectSteakosaurusBurger(object sender, RoutedEventArgs args) } /// - /// Selects the brontowurst as the entree. + /// Selects trex kingburger as the entree. /// /// /// @@ -126,7 +128,7 @@ private void SelectTRexKingburger(object sender, RoutedEventArgs args) } /// - /// Selects the brontowurst as the entree. + /// Selects veloci wrap as the entree. /// /// /// @@ -135,7 +137,9 @@ private void SelectVelociWrap(object sender, RoutedEventArgs args) entree = new VelociWrap(); SetUpEntreeSelection(); } - + /// + /// Prepares the EntreeSelection user interface. + /// private void SetUpEntreeSelection() { ClearButtonValues(); @@ -182,7 +186,9 @@ private void SetUpEntreeSelection() VelociWrapButton.BorderThickness = buttonBorderThickness; } } - + /// + /// Resets the button values. + /// private void ClearButtonValues() { BrontowurstButton.ClearValue(Control.BorderBrushProperty); diff --git a/PointOfSale/FlavorSelection.xaml.cs b/PointOfSale/FlavorSelection.xaml.cs index 0b5278fb..66adcb3d 100644 --- a/PointOfSale/FlavorSelection.xaml.cs +++ b/PointOfSale/FlavorSelection.xaml.cs @@ -29,7 +29,10 @@ public partial class FlavorSelection : Page private SodasaurusFlavor flavor; private Brush buttonColor = Brushes.LightGreen; - + /// + /// Initialize the FlavorSelection page. + /// + /// public FlavorSelection(Sodasaurus drink) { InitializeComponent(); @@ -61,7 +64,6 @@ private void SelectCancel(object sender, RoutedEventArgs args) } /// /// Sets the flavor to cherry. - /// Alters the user interface accordingly. /// /// /// @@ -73,7 +75,6 @@ private void SelectCherry(object sender, RoutedEventArgs args) } /// /// Sets the flavor to chocolate. - /// Alters the user interface accordingly. /// /// /// @@ -85,7 +86,6 @@ private void SelectChocolate(object sender, RoutedEventArgs args) } /// /// Sets the flavor to cola. - /// Alters the user interface accordingly. /// /// /// @@ -97,7 +97,6 @@ private void SelectCola(object sender, RoutedEventArgs args) } /// /// Sets the flavor to lime. - /// Alters the user interface accordingly. /// /// /// @@ -109,7 +108,6 @@ private void SelectLime(object sender, RoutedEventArgs args) } /// /// Sets the flavor to orange. - /// Alters the user interface accordingly. /// /// /// @@ -121,7 +119,6 @@ private void SelectOrange(object sender, RoutedEventArgs args) } /// /// Sets the flavor to root beer. - /// Alters the user interface accordingly. /// /// /// @@ -133,7 +130,6 @@ private void SelectRootBeer(object sender, RoutedEventArgs args) } /// /// Sets the flavor to cherry. - /// Alters the user interface accordingly. /// /// /// @@ -144,7 +140,7 @@ private void SelectVanilla(object sender, RoutedEventArgs args) flavor = SodasaurusFlavor.Vanilla; } /// - /// Sets the correct flavor button. + /// Prepares the FlavorSelection user interface. /// private void SetUpFlavorSelection() { @@ -158,7 +154,7 @@ private void SetUpFlavorSelection() if (flavor == SodasaurusFlavor.Vanilla) VanillaButton.Background = buttonColor; } /// - /// Clears the background property of all buttons. + /// Resets the button values. /// private void ClearButtonValues() { diff --git a/PointOfSale/SideSelection.xaml.cs b/PointOfSale/SideSelection.xaml.cs index 5e16b358..b7c50e4b 100644 --- a/PointOfSale/SideSelection.xaml.cs +++ b/PointOfSale/SideSelection.xaml.cs @@ -38,6 +38,17 @@ public SideSelection() InitializeComponent(); DisableButtons(); } + /// + /// Initialize the SideSelection page. + /// + /// + public SideSelection(Side currentSide) + { + InitializeComponent(); + DisableButtons(); + side = currentSide; + SetUpSideSelection(); + } /// /// Adds the entree to the order. @@ -148,7 +159,9 @@ private void SelectLarge(object sender, RoutedEventArgs args) MediumButton.ClearValue(Control.BackgroundProperty); LargeButton.Background = Brushes.LightGreen; } - + /// + /// Prepares the SideSelection user interface. + /// private void SetUpSideSelection() { ClearButtonValues(); @@ -185,7 +198,9 @@ private void SetUpSideSelection() TriceritotsButton.BorderThickness = buttonBorderThickness; } } - + /// + /// Resets the button values. + /// private void ClearButtonValues() { FryceritopsButton.ClearValue(Control.BorderBrushProperty);