public State GetState()
        {
            State temp;

            ErrorCodeHelper.ToResult(
                openXinput ? NativeOpenXinput.XInputGetState(userIndex, out temp) : NativeXinput.XInputGetState(userIndex, out temp)).CheckError();
            return(temp);
        }
 public Result GetKeystroke(DeviceQueryType deviceQueryType, out Keystroke keystroke)
 {
     return(ErrorCodeHelper.ToResult(
                openXinput ?
                NativeOpenXinput.XInputGetKeystroke(userIndex, (int)deviceQueryType, out keystroke) :
                NativeXinput.XInputGetKeystroke(userIndex, (int)deviceQueryType, out keystroke)
                ));
 }
        public Capabilities GetCapabilities(DeviceQueryType deviceQueryType)
        {
            Capabilities temp;

            ErrorCodeHelper.ToResult(
                openXinput ? NativeOpenXinput.XInputGetCapabilities(userIndex, deviceQueryType, out temp) :
                NativeXinput.XInputGetCapabilities(userIndex, deviceQueryType, out temp)
                ).CheckError();
            return(temp);
        }
        public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
        {
            BatteryInformation temp;

            ErrorCodeHelper.ToResult(
                openXinput ? NativeOpenXinput.XInputGetBatteryInformation((int)this.userIndex, batteryDeviceType, out temp) :
                NativeXinput.XInputGetBatteryInformation((int)this.userIndex, batteryDeviceType, out temp)
                ).CheckError();
            return(temp);
        }
 public static void SetReporting(bool enableReporting, bool openXinput)
 {
     if (openXinput)
     {
         NativeOpenXinput.XInputEnable(enableReporting);
     }
     else
     {
         NativeXinput.XInputEnable(enableReporting);
     }
 }
        public Result SetVibration(Vibration vibration)
        {
            Result result = ErrorCodeHelper.ToResult(openXinput ?
                                                     NativeOpenXinput.XInputSetState(userIndex, vibration) : NativeXinput.XInputSetState(userIndex, vibration));

            result.CheckError();
            return(result);
        }
 public bool GetState(out State state)
 {
     return((openXinput ?
             NativeOpenXinput.XInputGetState(userIndex, out state) :
             NativeXinput.XInputGetState(userIndex, out state)) == 0);
 }
 public bool GetCapabilities(DeviceQueryType deviceQueryType, out Capabilities capabilities)
 {
     return((openXinput ?
             NativeOpenXinput.XInputGetCapabilities(userIndex, deviceQueryType, out capabilities) :
             NativeXinput.XInputGetCapabilities(userIndex, deviceQueryType, out capabilities)) == 0);
 }