Ejemplo n.º 1
0
        /// <summary>
        /// Razer-SDK: Query for device information.
        /// </summary>
        internal static RazerError QueryDevice(Guid deviceId, out _DeviceInfo deviceInfo)
        {
            int    structSize    = Marshal.SizeOf(typeof(_DeviceInfo));
            IntPtr deviceInfoPtr = Marshal.AllocHGlobal(structSize);

            RazerError error = _queryDevicePointer(deviceId, deviceInfoPtr);

            deviceInfo = (_DeviceInfo)Marshal.PtrToStructure(deviceInfoPtr, typeof(_DeviceInfo));
            Marshal.FreeHGlobal(deviceInfoPtr);

            return(error);
        }
Ejemplo n.º 2
0
 private void ThrowRazerError(RazerError errorCode) => throw new RazerException(errorCode);
Ejemplo n.º 3
0
 /// <inheritdoc />
 /// <summary>
 /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerException" /> class.
 /// </summary>
 /// <param name="errorCode">The error code provided by the SDK.</param>
 public RazerException(RazerError errorCode)
 {
     this.ErrorCode = errorCode;
 }