-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathOpenRGBDeviceInfo.cs
52 lines (39 loc) · 1.31 KB
/
OpenRGBDeviceInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using RGB.NET.Core;
using OpenRGBDevice = OpenRGB.NET.Device;
namespace RGB.NET.Devices.OpenRGB;
/// <summary>
/// Represents generic information for an OpenRGB Device
/// </summary>
public class OpenRGBDeviceInfo : IRGBDeviceInfo
{
#region Properties & Fields
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
/// <inheritdoc />
public string DeviceName { get; }
/// <inheritdoc />
public string Manufacturer { get; }
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; }
/// <summary>
/// Gets the OpenRGB device.
/// </summary>
public OpenRGBDevice OpenRGBDevice { get; }
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of <see cref="OpenRGBDeviceInfo"/>.
/// </summary>
/// <param name="openRGBDevice">The OpenRGB device to extract information from.</param>
internal OpenRGBDeviceInfo(OpenRGBDevice openRGBDevice)
{
this.OpenRGBDevice = openRGBDevice;
DeviceType = Helper.GetRgbNetDeviceType(openRGBDevice.Type);
Manufacturer = Helper.GetVendorName(openRGBDevice);
Model = Helper.GetModelName(openRGBDevice);
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
}
#endregion
}