protected virtual void OnJoystickAction(ActionEventArgs e)
 {
     EventHandler<ActionEventArgs> handler = JoystickAction;
     if (handler != null)
     {
         handler(this, e);
     }
 }
 protected virtual void OnGamePadAction(ActionEventArgs e)
 {
     EventHandler<ActionEventArgs> handler = GamePadAction;
     if (handler != null)
     {
         handler(this, e);
     }
 }
 private void checkGamePads(Object sender, EventArgs e)
 {
     ActionEventArgs args = new ActionEventArgs(this.ActiveDevice);
     if (!args.GamePadState.Equals(oldgstate))
     {
         //call event
         OnGamePadAction(args);
         oldgstate = args.GamePadState;
     }
     if (!args.JoystickState.Equals(oldjstate))
     {
         //call event
         OnJoystickAction(args);
         oldjstate = args.JoystickState;
     }
 }
 private void controller_JoystickAction(object sender, ActionEventArgs e)
 {
     txtJoystickStateDebug.Text = e.JoystickState.ToString();
 }
 private void controller_GamePadAction(object sender, ActionEventArgs e)
 {
     txtGamePadStateDebug.Text = e.GamePadState.ToString();
 }