/// <summary>
        /// Click event for comboButton. Opens combo customization screen when button is clicked.
        /// </summary>
        /// <param name="sender">Reference to the object that raised the event.</param>
        /// <param name="e">Contains the event data.</param>
        void OpenComboCustomization(object sender, RoutedEventArgs e)
        {
            var coCustomization = new ComboCustomization((Order)this.DataContext);

            fullMenuSelectionGrid.Children.Clear();
            Combo co = new Combo();

            ((Order)this.DataContext).Add(co);
            coCustomization.DataContext = co;
            fullComponentBorder.Child   = coCustomization;
        }
 /// <summary>
 /// Click event for nextButton. Closes customization screen and saves relevant information when button is clicked.
 /// </summary>
 /// <param name="sender">Reference to the object that raised the event.</param>
 /// <param name="e">Contains the event data.</param>
 void NextItemOrder(object sender, RoutedEventArgs e)
 {
     if (!isCombo)
     {
         var menu = new MenuSelectionComponent();
         menu.DataContext = currentOrder;
         fullCustomizationGrid.Children.Clear();
         fullComponentBorder.Child = menu;
     }
     else
     {
         var coCustomization = new ComboCustomization(currentOrder);
         coCustomization.DataContext = currentCombo;
         fullCustomizationGrid.Children.Clear();
         fullComponentBorder.Child = coCustomization;
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Initalizes MainWindow an decalres variables for each
        /// of the screens.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new Order();

            menuSelect     = new MenuSelect(this);
            orderSummary   = new OrderSummary(this);
            paymentOptions = new PaymentOptions(this);
            cashRegister   = new CashRegister(this);

            comboCustom = new ComboCustomization(this);

            //Entrees
            bbCustom  = new BBurgerCustomization(this);
            ddCustom  = new DDraugrCustomization(this);
            ttCustom  = new TTripleCustomization(this);
            gooCustom = new GOOmeletteCustomization(this);
            ppCustom  = new PPoacherCustomization(this);
            ssCustom  = new SSkeletonCustomization(this);

            //Sides
            dbwfCustom = new DBWFriesCustomization(this);
            fmCustom   = new FMiraakCustomization(this);
            mogCustom  = new MOGritsCustomization(this);
            vsCustom   = new VSaladCustomization(this);

            //Drinks
            aajCustom   = new AAJuiceCustomization(this);
            ccCustom    = new CCoffeeCustomization(this);
            mmCustom    = new MMilkCustomization(this);
            ssodaCustom = new SSodaCustomization(this);
            wwCustom    = new WWaterCustomization(this);

            screen.Child      = menuSelect;
            orderScreen.Child = orderSummary;
        }
Esempio n. 4
0
        /// <summary>
        /// Given an IOrderItem <paramref name="item"/>, a customization screen is generated, and the correct
        /// <paramref name="text"/> is given back.
        /// </summary>
        /// <param name="item">The menu item to generate a customization screen for.</param>
        /// <param name="text">The text that will be displayed on the screen.</param>
        /// <returns>The customization screen for the specific item.</returns>
        public static CustomizationScreen GetCustomizationScreen(IOrderItem item, out string text)
        {
            CustomizationScreen screen = null;

            text = "Unknown";

            if (item is BriarheartBurger)
            {
                screen = new BriarheartBurgerCustomization(); text = "Customize Briarheart Burger";
            }
            else if (item is DoubleDraugr)
            {
                screen = new DoubleDraugrCustomization(); text = "Customize Double Draugr";
            }
            else if (item is GardenOrcOmelette)
            {
                screen = new GardenOrcOmeletteCustomization(); text = "Customize Garden Orc Omelette";
            }
            else if (item is PhillyPoacher)
            {
                screen = new PhillyPoacherCustomization(); text = "Customize Philly Poacher";
            }
            else if (item is SmokehouseSkeleton)
            {
                screen = new SmokehouseSkeletonCustomization(); text = "Customize Smokehouse Skeleton";
            }
            else if (item is ThalmorTriple)
            {
                screen = new ThalmorTripleCustomization(); text = "Customize Thalmor Triple";
            }
            else if (item is ThugsTBone)
            {
                screen = new ThugsTBoneCustomization(); text = "Customize ThugsTBone";
            }
            else if (item is AretinoAppleJuice)
            {
                screen = new AretinoAppleJuiceCustomization(); text = "Customize Aretino Apple Juice";
            }
            else if (item is CandlehearthCoffee)
            {
                screen = new CandlehearthCoffeeCustomization(); text = "Customize Candlehearth Coffee";
            }
            else if (item is MarkarthMilk)
            {
                screen = new MarkarthMilkCustomization(); text = "Customize Markarth Milk";
            }
            else if (item is SailorSoda)
            {
                screen = new SailorSodaCustomization(); text = "Customize Sailor Soda";
            }
            else if (item is WarriorWater)
            {
                screen = new WarriorWaterCustomization(); text = "Customize Warrior Water";
            }
            else if (item is Combo)
            {
                screen = new ComboCustomization(); text = "Customize Combo";
            }
            else
            {
                screen = new SideCustomization();
                if (item is DragonbornWaffleFries)
                {
                    text = "Customize Dragonborn Waffle Fries";
                }
                else if (item is FriedMiraak)
                {
                    text = "Customize Fried Miraak";
                }
                else if (item is MadOtarGrits)
                {
                    text = "Customize Mad Otar Grits";
                }
                else if (item is VokunSalad)
                {
                    text = "Customize Vokun Salad";
                }
            }

            screen.DataContext = item;

            return(screen);
        }
        /// <summary>
        /// Event when an item in the order list is selected. Opens the customization screen for that item.
        /// </summary>
        /// <param name="sender">Reference to the object that raised the event</param>
        /// <param name="e">Contains the event data.</param>
        void ChangeItemSelected(object sender, SelectionChangedEventArgs e)
        {
            var item = orderList.SelectedItem;

            if (item is Combo co)
            {
                ComboCustomization coc = new ComboCustomization((Order)this.DataContext);
                coc.DataContext = co;
                mscBorder.Child = coc;
            }
            else if (item is AretinoAppleJuice aj)
            {
                AretinoAppleJuiceCustomization ajc = new AretinoAppleJuiceCustomization(((Order)this.DataContext), false, null);
                ajc.DataContext = aj;
                mscBorder.Child = ajc;
            }
            else if (item is CandlehearthCoffee cc)
            {
                CandlehearthCoffeeCustomization ccc = new CandlehearthCoffeeCustomization(((Order)this.DataContext), false, null);
                ccc.DataContext = cc;
                mscBorder.Child = ccc;
            }
            else if (item is MarkarthMilk mm)
            {
                MarkarthMilkCustomization mmc = new MarkarthMilkCustomization(((Order)this.DataContext), false, null);
                mmc.DataContext = mm;
                mscBorder.Child = mmc;
            }
            else if (item is SailorSoda ss)
            {
                SailorSodaCustomization ssc = new SailorSodaCustomization(((Order)this.DataContext), false, null);
                ssc.DataContext = ss;
                mscBorder.Child = ssc;
            }
            else if (item is WarriorWater ww)
            {
                WarriorWaterCustomization wwc = new WarriorWaterCustomization(((Order)this.DataContext), false, null);
                wwc.DataContext = ww;
                mscBorder.Child = wwc;
            }
            else if (item is BriarheartBurger bb)
            {
                BriarheartBurgerCustomization bbc = new BriarheartBurgerCustomization(((Order)this.DataContext), false, null);
                bbc.DataContext = bb;
                mscBorder.Child = bbc;
            }
            else if (item is DoubleDraugr dd)
            {
                DoubleDraugrCustomization ddc = new DoubleDraugrCustomization(((Order)this.DataContext), false, null);
                ddc.DataContext = dd;
                mscBorder.Child = ddc;
            }
            else if (item is GardenOrcOmelette goo)
            {
                GardenOrcOmeletteCustomization gooc = new GardenOrcOmeletteCustomization(((Order)this.DataContext), false, null);
                gooc.DataContext = goo;
                mscBorder.Child  = gooc;
            }
            else if (item is PhillyPoacher pp)
            {
                PhillyPoacherCustomization ppc = new PhillyPoacherCustomization(((Order)this.DataContext), false, null);
                ppc.DataContext = pp;
                mscBorder.Child = ppc;
            }
            else if (item is SmokehouseSkeleton sms)
            {
                SmokehouseSkeletonCustomization smsc = new SmokehouseSkeletonCustomization(((Order)this.DataContext), false, null);
                smsc.DataContext = sms;
                mscBorder.Child  = smsc;
            }
            else if (item is ThalmorTriple tt)
            {
                ThalmorTripleCustomization ttc = new ThalmorTripleCustomization(((Order)this.DataContext), false, null);
                ttc.DataContext = tt;
                mscBorder.Child = ttc;
            }
            else if (item is ThugsTBone ttb)
            {
                ThugsTBoneCustomization ttbc = new ThugsTBoneCustomization(((Order)this.DataContext), false, null);
                ttbc.DataContext = ttb;
                mscBorder.Child  = ttbc;
            }
            else if (item is DragonbornWaffleFries dwf)
            {
                DragonbornWaffleFriesCustomization dwfc = new DragonbornWaffleFriesCustomization(((Order)this.DataContext), false, null);
                dwfc.DataContext = dwf;
                mscBorder.Child  = dwfc;
            }
            else if (item is FriedMiraak fm)
            {
                FriedMiraakCustomization fmc = new FriedMiraakCustomization(((Order)this.DataContext), false, null);
                fmc.DataContext = fm;
                mscBorder.Child = fmc;
            }
            else if (item is MadOtarGrits mog)
            {
                MadOtarGritsCustomization mogc = new MadOtarGritsCustomization(((Order)this.DataContext), false, null);
                mogc.DataContext = mog;
                mscBorder.Child  = mogc;
            }
            else if (item is VokunSalad vs)
            {
                VokunSaladCustomization vsc = new VokunSaladCustomization(((Order)this.DataContext), false, null);
                vsc.DataContext = vs;
                mscBorder.Child = vsc;
            }
        }