示例#1
0
        public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
        {
            BatteryInformation information;

            ErrorCodeHelper.ToResult(SharpDX.XInput.XInput.XInputGetBatteryInformation((int)this.userIndex, batteryDeviceType, out information)).CheckError();
            return(information);
        }
 public int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
示例#3
0
 /// <summary>
 /// Gets the battery information.
 /// </summary>
 /// <param name="batteryDeviceType">Type of the battery device.</param>
 /// <returns></returns>
 /// <unmanaged>unsigned int XInputGetBatteryInformation([In] XUSER_INDEX dwUserIndex,[In] BATTERY_DEVTYPE devType,[Out] XINPUT_BATTERY_INFORMATION* pBatteryInformation)</unmanaged>	
 public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
 {
     BatteryInformation temp;            
     var result =  ErrorCodeHelper.ToResult(XInput.XInputGetBatteryInformation((int)userIndex, batteryDeviceType, out temp));
     result.CheckError();
     return temp;
 }
示例#4
0
 public int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef)
 {
     return(Native.XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformationRef));
 }
示例#5
0
        public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
        {
            BatteryInformation batteryInformationRef;

            ErrorCodeHelper.ToResult(XInput.XInputGetBatteryInformation((int)this.userIndex, batteryDeviceType, out batteryInformationRef)).CheckError();
            return(batteryInformationRef);
        }
示例#6
0
 public static unsafe ErrorCode XInputGetBatteryInformation(int userIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation)
 {
     batteryInformation = new BatteryInformation();
     try { return(GetMethod <XInputGetBatteryInformationDelegate>("XInputGetBatteryInformation")(userIndex, (int)devType, out batteryInformation)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
示例#7
0
文件: XInput.cs 项目: tanis2000/FEZ
 public static unsafe int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     batteryInformationRef = new BatteryInformation();
       int batteryInformation;
       fixed (BatteryInformation* batteryInformationPtr = &batteryInformationRef)
     batteryInformation = XInput.XInputGetBatteryInformation_(dwUserIndex, (int) devType, (void*) batteryInformationPtr);
       return batteryInformation;
 }
        /// <summary>
        /// Gets the battery information.
        /// </summary>
        /// <param name="batteryDeviceType">Type of the battery device.</param>
        /// <returns></returns>
        /// <unmanaged>unsigned int XInputGetBatteryInformation([In] XUSER_INDEX dwUserIndex,[In] BATTERY_DEVTYPE devType,[Out] XINPUT_BATTERY_INFORMATION* pBatteryInformation)</unmanaged>
        public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
        {
            BatteryInformation temp;
            var result = ErrorCodeHelper.ToResult(xinput.XInputGetBatteryInformation((int)userIndex, batteryDeviceType, out temp));

            result.CheckError();
            return(temp);
        }
示例#9
0
文件: XInput.cs 项目: conankzhang/fez
        public static unsafe int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
        {
            batteryInformationRef = new BatteryInformation();
            int batteryInformation;

            fixed(BatteryInformation *batteryInformationPtr = &batteryInformationRef)
            batteryInformation = XInput.XInputGetBatteryInformation_(dwUserIndex, (int)devType, (void *)batteryInformationPtr);

            return(batteryInformation);
        }
        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);
        }
示例#11
0
 /// <summary>
 /// Retrieves the battery type and charge status of a wireless controller.
 /// </summary>
 /// <param name="userIndex">Index of the signed-in gamer associated with the device. Can be a value in the range 0–<see cref="UserIndex.MaxCount"/> − 1.</param>
 /// <param name="devType">Specifies which device associated with this user index should be queried. Must be <see cref="BatteryDeviceType.Gamepad"/> or <see cref="BatteryDeviceType.Headset"/>.</param>
 /// <param name="batteryInformation">An <see cref="BatteryInformation"/> structure that receives the battery information.</param>
 /// <returns>If the function succeeds, the return value is <see cref="Error.Success"/>.</returns>
 public static Error GetBatteryInformation(UserIndex userIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation)
 {
     return(XInputGetBatteryInformation(userIndex, devType, out batteryInformation));
 }
示例#12
0
 public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
 {
     BatteryInformation batteryInformationRef;
       ErrorCodeHelper.ToResult(XInput.XInputGetBatteryInformation((int) this.userIndex, batteryDeviceType, out batteryInformationRef)).CheckError();
       return batteryInformationRef;
 }
示例#13
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
示例#14
0
 private static extern Error XInputGetBatteryInformation(UserIndex userIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation);
示例#15
0
 public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
 {
     BatteryInformation information;
     ErrorCodeHelper.ToResult(SharpDX.XInput.XInput.XInputGetBatteryInformation((int) this.userIndex, batteryDeviceType, out information)).CheckError();
     return information;
 }
示例#16
0
 public static extern int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef);
示例#17
0
 /// <summary>
 /// Retrieves the battery type and charge status of a wireless controller.
 /// </summary>
 /// <param name="userIndex">Index of the user's controller. Can be a value in the range 0–3. </param>
 /// <param name="batteryDeviceType">Type of the battery device.</param>
 /// <param name="batteryInformation">The battery information.</param>
 /// <returns>True if succeed, false otherwise.</returns>
 public static bool GetBatteryInformation(int userIndex, BatteryDeviceType batteryDeviceType, out BatteryInformation batteryInformation)
 {
     return(s_xInput.XInputGetBatteryInformation(userIndex, batteryDeviceType, out batteryInformation) == 0);
 }
示例#18
0
 int IXInput.XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation)
 {
     throw new NotSupportedException("XInputGetBatteryInformation is not supported on XInput9.1.0");
 }
示例#19
0
 int IXInput.XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation)
 {
     return(XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformation));
 }
示例#20
0
 /// <summary>
 /// Retrieves the battery type and charge status of a wireless controller.
 /// </summary>
 /// <param name="userIndex">Index of the user's controller. Can be a value in the range 0–3. </param>
 /// <param name="batteryDeviceType">Type of the battery device.</param>
 /// <returns>Instance of <see cref="BatteryInformation"/>.</returns>
 public static BatteryInformation GetBatteryInformation(int userIndex, BatteryDeviceType batteryDeviceType)
 {
     s_xInput.XInputGetBatteryInformation(userIndex, batteryDeviceType, out var result);
     return(result);
 }
示例#21
0
 private static extern int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation);
示例#22
0
 /// <summary>
 /// Gets the battery information.
 /// 
 /// </summary>
 /// <param name="batteryDeviceType">Type of the battery device.</param>
 /// <returns/>
 /// <unmanaged>unsigned int XInputGetBatteryInformation([In] XUSER_INDEX dwUserIndex,[In] BATTERY_DEVTYPE devType,[Out] XINPUT_BATTERY_INFORMATION* pBatteryInformation)</unmanaged>
 public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
 {
     #if WINDOWS
     BatteryInformation batteryInformationRef;
     ErrorCodeHelper.ToResult(XInput.XInputGetBatteryInformation((int)this.userIndex, batteryDeviceType, out batteryInformationRef)).CheckError();
     return batteryInformationRef;
     #else
     return BatteryInformation.Empty;
     #endif
 }
示例#23
0
 public string[] StateBat()
 {
     BatteryDeviceType battery = new BatteryDeviceType();
     string[] Battery = new string[2];
     Battery[0] = this.joystick.GetBatteryInformation(battery).Type.ToString();
     Battery[1] = this.joystick.GetBatteryInformation(battery).Level.ToString();
     return Battery;
 }
示例#24
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     return XInput.XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformationRef);
 }
示例#25
0
 public static extern int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef);