1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00
RGB.NET/RGB.NET.Devices.OpenRGB/Abstract/AbstractOpenRGBDeviceInfo.cs
2022-09-25 15:25:20 +01:00

46 lines
1.4 KiB
C#

using RGB.NET.Core;
using System.Collections.Generic;
using OpenRGBDevice = OpenRGB.NET.Models.Device;
namespace RGB.NET.Devices.OpenRGB
{
/// <summary>
/// Represents generic information for an OpenRGB Device
/// </summary>
public abstract class AbstractOpenRGBDeviceInfo : IRGBDeviceInfo
{
/// <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; }
/// <summary>
/// Initializes a new instance of <see cref="AbstractOpenRGBDeviceInfo"/>.
/// </summary>
/// <param name="openRGBDevice">The OpenRGB device to extract information from.</param>
protected AbstractOpenRGBDeviceInfo(OpenRGBDevice openRGBDevice)
{
OpenRGBDevice = openRGBDevice;
DeviceType = Helper.GetRgbNetDeviceType(openRGBDevice.Type);
Manufacturer = Helper.GetVendorName(openRGBDevice);
Model = Helper.GetModelName(openRGBDevice);
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
}
}
}