private void ButtonColorChangeEvent(object parameter)
        {
            Brush brush = parameter as Brush;

            if (brush.GetType().Equals(typeof(SolidColorBrush)))
            {
                Color color = ((SolidColorBrush)parameter).Color;
                if (color.Equals(Colors.Red))
                {
                    ModuleData.Color = ButtonColor.Red;
                }
                else if (color.Equals(Colors.Blue))
                {
                    ModuleData.Color = ButtonColor.Blue;
                }
                else if (color.Equals(Colors.Yellow))
                {
                    ModuleData.Color = ButtonColor.Yellow;
                }
                else if (color.Equals(Colors.White))
                {
                    ModuleData.Color = ButtonColor.White;
                }
            }
            ModuleData.Strip = ButtonColor.Disabled;
            StripColor       = App.CheckeredBrush;
            OnPropertyChanged(nameof(StripColor));
            LargeButton.SetButtonColor(ModuleData.Color);
            ModuleSolver.SolveButton(BombManager, ref ModuleData);
        }
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var content = ((ListBoxItem)ButtonTextList.SelectedItem).Content;

            if (content != null)
            {
                content = content.ToString();
                if (content.Equals("Abort"))
                {
                    ModuleData.Text = ButtonText.Abort;
                }
                else if (content.Equals("Detonate"))
                {
                    ModuleData.Text = ButtonText.Detonate;
                }
                else if (content.Equals("Hold"))
                {
                    ModuleData.Text = ButtonText.Hold;
                }
                else if (content.Equals("Press"))
                {
                    ModuleData.Text = ButtonText.Press;
                }
                ModuleData.Strip = ButtonColor.Disabled;
                StripColor       = App.CheckeredBrush;
                OnPropertyChanged(nameof(StripColor));
                LargeButton.SetButtonText(ModuleData.Text);
                ModuleSolver.SolveButton(BombManager, ref ModuleData);
            }
        }
Exemplo n.º 3
0
        public static string Generate()
        {
            var button1 = new XSmallButton("x-Small");
            var button2 = new SmallButton("Small");
            var button3 = new PrimaryButton("Regular");
            var button4 = new LargeButton("Large");

            return(button1.ToHtml() + "  " + button2.ToHtml() + button3.ToHtml() + button4.ToHtml());
        }
Exemplo n.º 4
0
        /// <summary>
        /// sets the selected side
        /// </summary>
        /// <param name="side"></param>
        void SetSelectedSide(Side side)
        {
            if (side is Fryceritops fry)
            {
                Fryceritops.Background = new SolidColorBrush(Colors.LightBlue);
                Triceritots.ClearValue(Button.BackgroundProperty);
                MeteorMacAndCheese.ClearValue(Button.BackgroundProperty);
                MezzorellaSticks.ClearValue(Button.BackgroundProperty);
            }
            else if (side is Triceritots tots)
            {
                Fryceritops.ClearValue(Button.BackgroundProperty);
                Triceritots.Background = new SolidColorBrush(Colors.LightBlue);
                MeteorMacAndCheese.ClearValue(Button.BackgroundProperty);
                MezzorellaSticks.ClearValue(Button.BackgroundProperty);
            }
            else if (side is MeteorMacAndCheese mac)
            {
                Fryceritops.ClearValue(Button.BackgroundProperty);
                Triceritots.ClearValue(Button.BackgroundProperty);
                MeteorMacAndCheese.Background = new SolidColorBrush(Colors.LightBlue);
                MezzorellaSticks.ClearValue(Button.BackgroundProperty);
            }
            else if (side is MezzorellaSticks sticks)
            {
                Fryceritops.ClearValue(Button.BackgroundProperty);
                Triceritots.ClearValue(Button.BackgroundProperty);
                MeteorMacAndCheese.ClearValue(Button.BackgroundProperty);
                MezzorellaSticks.Background = new SolidColorBrush(Colors.LightBlue);
            }

            switch (side.Size)
            {
            case DinoDiner.Menu.Size.Small:
                SmallButton.Background = new SolidColorBrush(Colors.LightBlue);
                MediumButton.ClearValue(Button.BackgroundProperty);
                LargeButton.ClearValue(Button.BackgroundProperty);
                break;

            case DinoDiner.Menu.Size.Medium:
                MediumButton.Background = new SolidColorBrush(Colors.LightBlue);
                SmallButton.ClearValue(Button.BackgroundProperty);
                LargeButton.ClearValue(Button.BackgroundProperty);
                break;

            case DinoDiner.Menu.Size.Large:
                LargeButton.Background = new SolidColorBrush(Colors.LightBlue);
                SmallButton.ClearValue(Button.BackgroundProperty);
                MediumButton.ClearValue(Button.BackgroundProperty);
                break;
            }
        }
Exemplo n.º 5
0
        public void RenderLargeButton(HtmlTextWriter output, Ribbon ribbon, string id, string header, string icon,
            string tooltip, string command, bool enabled, bool down, CommandContext context)
        {
            var buttonId = Control.GetUniqueID("script");
            var largeButton = new LargeButton
            {
                ID = buttonId,
                Header = header,
                Icon = icon,
                Down = down,
                Enabled = enabled,
                ToolTip = tooltip,
                Command = GetClick(command, context, buttonId),
            };

            largeButton.RenderControl(output);
        }
Exemplo n.º 6
0
        public void RenderLargeButton(HtmlTextWriter output, Ribbon ribbon, string id, string header, string icon,
                                      string tooltip, string command, bool enabled, bool down, CommandContext context)
        {
            var buttonId    = Control.GetUniqueID("script");
            var largeButton = new LargeButton
            {
                ID      = buttonId,
                Header  = header,
                Icon    = icon,
                Down    = down,
                Enabled = enabled,
                ToolTip = tooltip,
                Command = GetClick(command, context, buttonId),
            };

            largeButton.RenderControl(output);
        }
Exemplo n.º 7
0
        /// <summary>
        /// sets combo size
        /// </summary>
        void SetSelectedSize()
        {
            switch (_combo.Size)
            {
            case DinoDiner.Menu.Size.Small:
                SmallButton.Background = new SolidColorBrush(Colors.LightBlue);
                MediumButton.ClearValue(Button.BackgroundProperty);
                LargeButton.ClearValue(Button.BackgroundProperty);
                break;

            case DinoDiner.Menu.Size.Medium:
                MediumButton.Background = new SolidColorBrush(Colors.LightBlue);
                SmallButton.ClearValue(Button.BackgroundProperty);
                LargeButton.ClearValue(Button.BackgroundProperty);
                break;

            case DinoDiner.Menu.Size.Large:
                LargeButton.Background = new SolidColorBrush(Colors.LightBlue);
                SmallButton.ClearValue(Button.BackgroundProperty);
                MediumButton.ClearValue(Button.BackgroundProperty);
                break;
            }
        }
Exemplo n.º 8
0
        public void RenderButton(HtmlTextWriter output, ID buttonTemplateId, Ribbon ribbon, string id, string header, string icon,
                                 string tooltip, string command, bool enabled, CommandContext context, string menuPath)
        {
            var buttonId = Control.GetUniqueID("script");

            if (buttonTemplateId == Ribbon.LargeButton)
            {
                var button = new LargeButton
                {
                    ID      = buttonId,
                    Header  = header,
                    Icon    = icon,
                    Enabled = enabled,
                    ToolTip = tooltip,
                    Command = GetClick(command, context, buttonId),
                };
                button.RenderControl(output);
            }
            else if (buttonTemplateId == Ribbon.LargeMenuComboButton)
            {
                var button = new LargeMenuComboButton
                {
                    ID             = buttonId,
                    Header         = header,
                    Icon           = icon,
                    Enabled        = enabled,
                    ToolTip        = tooltip,
                    Command        = GetClick(command, context, buttonId),
                    CommandContext = context,
                    Menu           = menuPath
                };
                button.RenderControl(output);
            }
            else if (buttonTemplateId == Ribbon.SmallButton)
            {
                var button = new SmallButton
                {
                    ID      = buttonId,
                    Header  = header,
                    Icon    = icon,
                    Enabled = enabled,
                    ToolTip = tooltip,
                    Command = GetClick(command, context, buttonId),
                };
                ribbon.RenderSmallButton(output, button);
            }
            else if (buttonTemplateId == Ribbon.SmallMenuComboButton)
            {
                var button = new SmallMenuComboButton
                {
                    ID             = buttonId,
                    Header         = header,
                    Icon           = icon,
                    Enabled        = enabled,
                    ToolTip        = tooltip,
                    Command        = GetClick(command, context, buttonId),
                    CommandContext = context,
                    Menu           = menuPath
                };
                ribbon.RenderSmallButton(output, button);
            }
        }