using System; using System.Runtime.InteropServices; using CUE.NET.Devices.Generic.Enums; using CUE.NET.Native; namespace CUE.NET.Devices.Generic { public class GenericDeviceInfo : IDeviceInfo { #region Properties & Fields /// /// Device type. /// public CorsairDeviceType Type { get; } /// /// Device model (like “K95RGB”). /// public string Model { get; } /// /// Flags that describes device capabilities /// public CorsairDeviceCaps CapsMask { get; } #endregion #region Constructors /// /// Internal constructor of managed CorsairDeviceInfo. /// /// The native CorsairDeviceInfo-struct internal GenericDeviceInfo(_CorsairDeviceInfo nativeInfo) { this.Type = nativeInfo.type; this.Model = nativeInfo.model == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeInfo.model); this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask; } #endregion } }