using System;
using System.Runtime.InteropServices;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
{
///
///
/// Represents a generic information for a Corsair-.
///
public class CorsairRGBDeviceInfo : IRGBDeviceInfo
{
#region Properties & Fields
///
/// Gets the corsair specific device type.
///
public CorsairDeviceType CorsairDeviceType { get; }
///
/// Gets the index of the .
///
public int CorsairDeviceIndex { get; }
///
public RGBDeviceType DeviceType { get; }
///
public string Manufacturer => "Corsair";
///
public string Model { get; }
///
public Uri Image { get; set; }
///
public bool SupportsSyncBack => true;
///
public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;
///
/// Gets a flag that describes device capabilities. ()
///
public CorsairDeviceCaps CapsMask { get; }
#endregion
#region Constructors
///
/// Internal constructor of managed .
///
/// The index of the .
/// The type of the .
/// The native -struct
internal CorsairRGBDeviceInfo(int deviceIndex, RGBDeviceType deviceType, _CorsairDeviceInfo nativeInfo)
{
this.CorsairDeviceIndex = deviceIndex;
this.DeviceType = deviceType;
this.CorsairDeviceType = nativeInfo.type;
this.Model = nativeInfo.model == IntPtr.Zero ? null : Marshal.PtrToStringAnsi(nativeInfo.model);
this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask;
}
#endregion
}
}