// ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedMember.Global using System; using System.IO; using System.Reflection; using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair { /// /// Represents a generic information for a . /// public class CorsairKeyboardRGBDeviceInfo : CorsairRGBDeviceInfo { #region Properties & Fields /// /// Gets the physical layout of the keyboard. /// public CorsairPhysicalKeyboardLayout PhysicalLayout { get; } /// /// Gets the logical layout of the keyboard as set in CUE settings. /// public CorsairLogicalKeyboardLayout LogicalLayout { get; } #endregion #region Constructors /// /// Internal constructor of managed . /// /// The index of the . /// The native -struct internal CorsairKeyboardRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) : base(deviceIndex, Core.RGBDeviceType.Keyboard, nativeInfo) { this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout; this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout; Image = new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), $@"Images\Corsair\Keyboards\{Model.Replace(" ", string.Empty).ToUpper()}\{LogicalLayout.ToString().ToUpper()}.png"), UriKind.Absolute); } #endregion } }