// ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedMember.Global using System; using System.Globalization; using System.IO; using System.Reflection; using RGB.NET.Core; namespace RGB.NET.Devices.Logitech { /// /// Represents a generic information for a . /// public class LogitechKeyboardRGBDeviceInfo : LogitechRGBDeviceInfo { #region Properties & Fields /// /// Gets the physical layout of the keyboard. /// public LogitechPhysicalKeyboardLayout PhysicalLayout { get; private set; } /// /// Gets the logical layout of the keyboard. /// public LogitechLogicalKeyboardLayout LogicalLayout { get; private set; } #endregion #region Constructors /// /// Internal constructor of managed . /// /// The type of the . /// The represented device model. /// The lighting-capabilities of the device. /// The of the layout this keyboard is using internal LogitechKeyboardRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps, CultureInfo culture) : base(deviceType, model, deviceCaps) { SetLayouts(culture.KeyboardLayoutId); Image = new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), $@"Images\Logitech\Keyboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute); } private void SetLayouts(int keyboardLayoutId) { switch (keyboardLayoutId) { //TODO DarthAffe 04.02.2017: Check all available keyboards and there layout-ids default: PhysicalLayout = LogitechPhysicalKeyboardLayout.UK; LogicalLayout = LogitechLogicalKeyboardLayout.DE; break; } } #endregion } }