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);
            }
        }
 private void GetSolution(ColorChangeEventArgs args, int index)
 {
     if (args.NewColor != args.OldColor)
     {
         ModuleData.Wires[index] = args.NewColor;
         ModuleSolver.SolveSimpleWires(BombManager, ref ModuleData);
     }
 }
 private void TextInput_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (!string.IsNullOrEmpty(TextField.InputText))
     {
         ModuleData.Input = TextField.InputText;
         ModuleSolver.SolveMorseCode(ref ModuleData);
     }
 }
Exemplo n.º 5
0
 private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     ModuleData.FirstColumn  = InputA.Text;
     ModuleData.SecondColumn = InputB.Text;
     ModuleData.ThirdColumn  = InputC.Text;
     ModuleData.FourthColumn = InputD.Text;
     ModuleData.FifthColumn  = InputE.Text;
     ModuleSolver.SolvePassword(ref ModuleData);
 }
Exemplo n.º 6
0
 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (MainSelection.SelectedItems.Count > 4)
     {
         MainSelection.UnselectAll();
     }
     else
     {
         ModuleData.Selected = new int[] { -1, -1, -1, -1 };
         int i = 0;
         foreach (ListBoxItem item in MainSelection.SelectedItems)
         {
             ModuleData.Selected[i] = (int)item.Tag;
             i++;
         }
         ModuleSolver.SolveKeypads(ref ModuleData);
     }
 }