예제 #1
0
 public void ledWiz_InputChange(object sender, LedWizInputArgs e)
 {
     foreach (var update in e.LedWizUpdates.Where(x => x.JoystickButton == JoystickButton.Button10 && x.Value > 0))
     {
         Dispatcher.Invoke(() =>
                           GamesList.SelectedItem = GamesList.SelectedIndex == GamesList.Items.Count - 1
                 ? GamesList.Items[0]
                 : GamesList.Items[GamesList.SelectedIndex + 1]);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button1 && x.Value > 0))
     {
         Dispatcher.Invoke(() => GameStart(this, new GameStartEventArgs {
             Game = ((ISkeeBawlGameListItem)GamesList.SelectedItem).GetGame()
         }));
     }
 }
예제 #2
0
 public void LedWizInputChange(object sender, LedWizInputArgs e)
 {
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.JoyUp && x.Value > 0))
     {
         RunMethod(Settings.Default.JoyUp);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.JoyDown && x.Value > 0))
     {
         RunMethod(Settings.Default.JoyDown);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.JoyLeft && x.Value > 0))
     {
         RunMethod(Settings.Default.JoyLeft);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.JoyRight && x.Value > 0))
     {
         RunMethod(Settings.Default.JoyRight);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button12 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button12);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button11 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button11);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button10 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button10);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button9 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button9);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button8 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button8);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button7 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button7);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button6 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button6);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button5 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button5);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button4 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button4);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button3 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button3);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button2 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button2);
     }
     if (e.LedWizUpdates.Any(x => x.JoystickButton == JoystickButton.Button1 && x.Value > 0))
     {
         RunMethod(Settings.Default.Button1);
     }
 }