Fixed warnings

This commit is contained in:
DarthAffe committed 2021-02-02 23:37:56 +01:00
1 parent 57dc9afb32
commit a0a1521658
118 files changed
+802 -1181

No files matched your search

@@ -15,8 +15,8 @@ namespace RGB.NET.Devices.Wooting.Keyboard
#region Wooting One
private static readonly Dictionary<LedId, (int row, int column)> WootingOne_US = new Dictionary<LedId, (int row, int column)>
{
private static readonly Dictionary<LedId, (int row, int column)> WootingOne_US = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
{ LedId.Keyboard_F2, (0,3) },
@@ -111,8 +111,8 @@ namespace RGB.NET.Devices.Wooting.Keyboard
{ LedId.Keyboard_ArrowRight, (5,16) }
};
private static readonly Dictionary<LedId, (int row, int column)> WootingOne_UK = new Dictionary<LedId, (int row, int column)>
{
private static readonly Dictionary<LedId, (int row, int column)> WootingOne_UK = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
{ LedId.Keyboard_F2, (0,3) },
@@ -213,8 +213,8 @@ namespace RGB.NET.Devices.Wooting.Keyboard
#region Wooting Two
private static readonly Dictionary<LedId, (int row, int column)> WootingTwo_US = new Dictionary<LedId, (int row, int column)>
{
private static readonly Dictionary<LedId, (int row, int column)> WootingTwo_US = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
{ LedId.Keyboard_F2, (0,3) },
@@ -330,8 +330,8 @@ namespace RGB.NET.Devices.Wooting.Keyboard
{ LedId.Keyboard_NumPeriodAndDelete, (5,19) }
};
private static readonly Dictionary<LedId, (int row, int column)> WootingTwo_UK = new Dictionary<LedId, (int row, int column)>
{
private static readonly Dictionary<LedId, (int row, int column)> WootingTwo_UK = new()
{
{ LedId.Keyboard_Escape, (0,0) },
{ LedId.Keyboard_F1, (0,2) },
{ LedId.Keyboard_F2, (0,3) },
@@ -455,7 +455,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard
/// Contains all the hardware-id mappings for Wooting devices.
/// </summary>
public static readonly Dictionary<WootingDevicesIndexes, Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>> Mapping =
new Dictionary<WootingDevicesIndexes, Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>>
new()
{
{ WootingDevicesIndexes.WootingOne, new Dictionary<WootingPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>>
{
@@ -39,7 +39,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard
protected override object GetLedCustomData(LedId ledId) => WootingKeyboardLedMappings.Mapping[DeviceInfo.DeviceIndex][DeviceInfo.PhysicalLayout][ledId];
/// <inheritdoc />
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue?.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
#endregion
}
@@ -18,11 +18,6 @@ namespace RGB.NET.Devices.Wooting.Keyboard
/// </summary>
public WootingPhysicalKeyboardLayout PhysicalLayout { get; }
/// <summary>
/// Gets the <see cref="WootingLogicalKeyboardLayout"/> of the <see cref="WootingKeyboardRGBDevice"/>.
/// </summary>
public WootingLogicalKeyboardLayout LogicalLayout { get; private set; }
#endregion
#region Constructors
@@ -33,29 +28,10 @@ namespace RGB.NET.Devices.Wooting.Keyboard
/// </summary>
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDevice" />.</param>
/// <param name="physicalKeyboardLayout">The <see cref="T:RGB.NET.Devices.Wooting.WootingPhysicalKeyboardLayout" /> of the <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDevice" />.</param>
/// <param name="culture">The <see cref="T:System.Globalization.CultureInfo" /> of the layout this keyboard is using</param>
internal WootingKeyboardRGBDeviceInfo(WootingDevicesIndexes deviceIndex, WootingPhysicalKeyboardLayout physicalKeyboardLayout,
CultureInfo culture)
internal WootingKeyboardRGBDeviceInfo(WootingDevicesIndexes deviceIndex, WootingPhysicalKeyboardLayout physicalKeyboardLayout)
: base(RGBDeviceType.Keyboard, deviceIndex)
{
this.PhysicalLayout = physicalKeyboardLayout;
DetermineLogicalLayout(culture.KeyboardLayoutId);
}
private void DetermineLogicalLayout(int keyboardLayoutId)
{
switch (keyboardLayoutId)
{
// TODO SpoinkyNL 15-12-2019: There doesn't seem to be an accurate way to determine this, perhaps it should be a configurable thing..
// I'm using US International and it's reporting nl-NL's 1043. Also you can after all just swap your keycaps
default:
if (PhysicalLayout == WootingPhysicalKeyboardLayout.US)
LogicalLayout = WootingLogicalKeyboardLayout.US;
else
LogicalLayout = WootingLogicalKeyboardLayout.UK;
break;
}
}
#endregion