using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Logitech
{
///
///
/// Represents a generic information for a Logitech-.
///
public class LogitechRGBDeviceInfo : IRGBDeviceInfo
{
#region Properties & Fields
///
public RGBDeviceType DeviceType { get; }
///
public string Manufacturer => "Logitech";
///
public string Model { get; }
///
public Uri Image { get; protected set; }
///
public RGBDeviceLighting Lighting
{
get
{
if (DeviceCaps.HasFlag(LogitechDeviceCaps.PerKeyRGB))
return RGBDeviceLighting.Key;
if (DeviceCaps.HasFlag(LogitechDeviceCaps.DeviceRGB))
return RGBDeviceLighting.Device;
return RGBDeviceLighting.None;
}
}
///
public bool SupportsSyncBack => false;
///
/// Gets a flag that describes device capabilities. ()
///
public LogitechDeviceCaps DeviceCaps { get; }
///
/// Gets the base of the image path used to load device-images.
///
internal string ImageBasePath { get; }
///
/// Gets the layout used to decide which images to load.
///
internal string ImageLayout { get; }
///
/// Gets the path/name of the layout-file.
///
internal string LayoutPath { get; }
#endregion
#region Constructors
///
/// Internal constructor of managed .
///
/// The type of the .
/// The represented device model.
/// The lighting-capabilities of the device.
/// The base of the image path used to load device-images.
/// The layout used to decide which images to load.
/// The path/name of the layout-file.
internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps,
string imageBasePath, string imageLayout, string layoutPath)
{
this.DeviceType = deviceType;
this.Model = model;
this.DeviceCaps = deviceCaps;
this.ImageBasePath = imageBasePath;
this.ImageLayout = imageLayout;
this.LayoutPath = layoutPath;
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Logitech\{LayoutPath}.png"), UriKind.Absolute);
}
#endregion
}
}