From 4466acfbf726aeb36a923d65894d195384632e51 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Tue, 1 Jun 2021 22:19:42 +0200 Subject: [PATCH 1/6] Fixed compiler messages --- RGB.NET.Core/RGBSurface.cs | 4 ++-- RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs | 4 +++- RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs | 2 -- .../Enum/CorsairLogicalKeyboardLayout.cs | 2 -- RGB.NET.Devices.Corsair/Generic/LedMappings.cs | 16 ++++++++-------- .../Native/_CorsairChannelDeviceInfo.cs | 2 ++ .../Native/_CorsairChannelInfo.cs | 1 + .../Native/_CorsairChannelsInfo.cs | 1 + .../Native/_CorsairDeviceInfo.cs | 1 + .../Native/_CorsairLedPosition.cs | 1 + 10 files changed, 19 insertions(+), 15 deletions(-) diff --git a/RGB.NET.Core/RGBSurface.cs b/RGB.NET.Core/RGBSurface.cs index 033d33e..34eabd3 100644 --- a/RGB.NET.Core/RGBSurface.cs +++ b/RGB.NET.Core/RGBSurface.cs @@ -18,11 +18,11 @@ namespace RGB.NET.Core { #region Properties & Fields - private Stopwatch _deltaTimeCounter; + private readonly Stopwatch _deltaTimeCounter; private readonly IList _devices = new List(); private readonly IList _updateTriggers = new List(); - private readonly List _ledGroups = new List(); + private readonly List _ledGroups = new(); /// /// Gets a readonly list containing all loaded . diff --git a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs index 03dcdcd..8884945 100644 --- a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs +++ b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs @@ -43,7 +43,7 @@ namespace RGB.NET.Devices.Corsair /// /// Gets the last error documented by CUE. /// - public CorsairError LastError => _CUESDK.CorsairGetLastError(); + public static CorsairError LastError => _CUESDK.CorsairGetLastError(); #endregion @@ -207,6 +207,8 @@ namespace RGB.NET.Devices.Corsair try { _CUESDK.UnloadCUESDK(); } catch { /* at least we tried */ } + + GC.SuppressFinalize(this); } #endregion diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs b/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs index 785a4e7..da23132 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs @@ -1,7 +1,5 @@ // ReSharper disable InconsistentNaming -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member - namespace RGB.NET.Devices.Corsair { /// diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs b/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs index 6217571..ce8ea57 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs @@ -1,8 +1,6 @@ // ReSharper disable InconsistentNaming // ReSharper disable UnusedMember.Global -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member - namespace RGB.NET.Devices.Corsair { /// diff --git a/RGB.NET.Devices.Corsair/Generic/LedMappings.cs b/RGB.NET.Devices.Corsair/Generic/LedMappings.cs index d2502dd..4547e12 100644 --- a/RGB.NET.Devices.Corsair/Generic/LedMappings.cs +++ b/RGB.NET.Devices.Corsair/Generic/LedMappings.cs @@ -28,19 +28,19 @@ namespace RGB.NET.Devices.Corsair Keyboard.Add(LedId.Custom101 + i, CorsairLedId.OemLed101 + i); } - public static LedMapping GraphicsCard = new(); - public static LedMapping HeadsetStand = new(); - public static LedMapping Mainboard = new(); - public static LedMapping Memory = new(); - public static LedMapping Mousepad = new(); + public static LedMapping GraphicsCard { get; } = new(); + public static LedMapping HeadsetStand { get; } = new(); + public static LedMapping Mainboard { get; } = new(); + public static LedMapping Memory { get; } = new(); + public static LedMapping Mousepad { get; } = new(); - public static LedMapping Headset = new() + public static LedMapping Headset { get; } = new() { { LedId.Headset1, CorsairLedId.LeftLogo }, { LedId.Headset2, CorsairLedId.RightLogo }, }; - public static LedMapping Mouse = new() + public static LedMapping Mouse { get; } = new() { { LedId.Mouse1, CorsairLedId.B1 }, { LedId.Mouse2, CorsairLedId.B2 }, @@ -64,7 +64,7 @@ namespace RGB.NET.Devices.Corsair { LedId.Mouse20, CorsairLedId.B20 }, }; - public static LedMapping Keyboard = new() + public static LedMapping Keyboard { get; } = new() { { LedId.Invalid, CorsairLedId.Invalid }, { LedId.Logo, CorsairLedId.Logo }, diff --git a/RGB.NET.Devices.Corsair/Native/_CorsairChannelDeviceInfo.cs b/RGB.NET.Devices.Corsair/Native/_CorsairChannelDeviceInfo.cs index d3ce82f..117258c 100644 --- a/RGB.NET.Devices.Corsair/Native/_CorsairChannelDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Native/_CorsairChannelDeviceInfo.cs @@ -1,6 +1,7 @@ #pragma warning disable 169 // Field 'x' is never used #pragma warning disable 414 // Field 'x' is assigned but its value never used #pragma warning disable 649 // Field 'x' is never assigned +#pragma warning disable IDE1006 // Naming Styles using System.Runtime.InteropServices; @@ -11,6 +12,7 @@ namespace RGB.NET.Devices.Corsair.Native /// CUE-SDK: contains information about separate LED-device connected to the channel controlled by the DIY-device. /// [StructLayout(LayoutKind.Sequential)] + internal class _CorsairChannelDeviceInfo { /// diff --git a/RGB.NET.Devices.Corsair/Native/_CorsairChannelInfo.cs b/RGB.NET.Devices.Corsair/Native/_CorsairChannelInfo.cs index 5933b4e..c2250ea 100644 --- a/RGB.NET.Devices.Corsair/Native/_CorsairChannelInfo.cs +++ b/RGB.NET.Devices.Corsair/Native/_CorsairChannelInfo.cs @@ -1,6 +1,7 @@ #pragma warning disable 169 // Field 'x' is never used #pragma warning disable 414 // Field 'x' is assigned but its value never used #pragma warning disable 649 // Field 'x' is never assigned +#pragma warning disable IDE1006 // Naming Styles using System; using System.Runtime.InteropServices; diff --git a/RGB.NET.Devices.Corsair/Native/_CorsairChannelsInfo.cs b/RGB.NET.Devices.Corsair/Native/_CorsairChannelsInfo.cs index 8dacba2..6eab5bd 100644 --- a/RGB.NET.Devices.Corsair/Native/_CorsairChannelsInfo.cs +++ b/RGB.NET.Devices.Corsair/Native/_CorsairChannelsInfo.cs @@ -1,6 +1,7 @@ #pragma warning disable 169 // Field 'x' is never used #pragma warning disable 414 // Field 'x' is assigned but its value never used #pragma warning disable 649 // Field 'x' is never assigned +#pragma warning disable IDE1006 // Naming Styles using System; using System.Runtime.InteropServices; diff --git a/RGB.NET.Devices.Corsair/Native/_CorsairDeviceInfo.cs b/RGB.NET.Devices.Corsair/Native/_CorsairDeviceInfo.cs index 418e9f6..84b6077 100644 --- a/RGB.NET.Devices.Corsair/Native/_CorsairDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Native/_CorsairDeviceInfo.cs @@ -1,6 +1,7 @@ #pragma warning disable 169 // Field 'x' is never used #pragma warning disable 414 // Field 'x' is assigned but its value never used #pragma warning disable 649 // Field 'x' is never assigned +#pragma warning disable IDE1006 // Naming Styles using System; using System.Runtime.InteropServices; diff --git a/RGB.NET.Devices.Corsair/Native/_CorsairLedPosition.cs b/RGB.NET.Devices.Corsair/Native/_CorsairLedPosition.cs index 4ea4356..106c01d 100644 --- a/RGB.NET.Devices.Corsair/Native/_CorsairLedPosition.cs +++ b/RGB.NET.Devices.Corsair/Native/_CorsairLedPosition.cs @@ -1,6 +1,7 @@ #pragma warning disable 169 // Field 'x' is never used #pragma warning disable 414 // Field 'x' is assigned but its value never used #pragma warning disable 649 // Field 'x' is never assigned +#pragma warning disable IDE1006 // Naming Styles using System.Runtime.InteropServices; From 7b0e9152fd8ebf40cbdfb6d0711dba41358dc980 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Tue, 1 Jun 2021 23:53:56 +0200 Subject: [PATCH 2/6] Fixed code issues --- RGB.NET.Core/Color/HclColor.cs | 5 +- RGB.NET.Core/Color/LabColor.cs | 1 + RGB.NET.Core/Devices/IRGBDeviceProvider.cs | 4 +- RGB.NET.Core/Extensions/PointExtensions.cs | 2 +- RGB.NET.Core/Groups/ListLedGroup.cs | 5 +- RGB.NET.Core/Positioning/IPlaceable.cs | 4 +- RGB.NET.Core/Positioning/Point.cs | 14 +- .../Rendering/Textures/PixelTexture.cs | 2 +- RGB.NET.Core/Update/AbstractUpdateTrigger.cs | 1 + RGB.NET.Core/Update/Devices/UpdateQueue.cs | 4 +- RGB.NET.Core/Update/ManualUpdateTrigger.cs | 2 +- RGB.NET.Core/Update/TimerUpdateTrigger.cs | 10 +- .../Keyboard/AsusKeyboardLedMapping.cs | 336 +++++++++--------- .../Keyboard/AsusKeyboardRGBDeviceInfo.cs | 7 +- .../Generic/CoolerMasterRGBDeviceInfo.cs | 2 +- .../Generic/CoolerMasterUpdateQueue.cs | 5 +- .../Helper/EnumExtension.cs | 2 +- .../Mouse/CoolerMasterMouseRGBDevice.cs | 4 +- .../Native/_CoolerMasterSDK.cs | 12 +- .../CorsairDeviceProvider.cs | 2 +- RGB.NET.Devices.Corsair/Native/_CUESDK.cs | 7 +- .../Native/_CorsairLedColor.cs | 2 + RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs | 4 +- .../Enum/LogitechLedId.cs | 2 +- .../LogitechDeviceProvider.cs | 14 +- .../Native/_LogitechGSDK.cs | 7 +- .../Zone/LogitechZoneRGBDevice.cs | 2 +- RGB.NET.Devices.Msi/Native/_MsiSDK.cs | 9 +- .../Generic/LimitedColorUpdateQueue.cs | 17 +- .../Generic/MidiUpdateQueue.cs | 5 +- .../Launchpad/NovationLaunchpadRGBDevice.cs | 2 + RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs | 4 +- RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs | 6 +- RGB.NET.Devices.Razer/Enum/RazerError.cs | 2 +- RGB.NET.Devices.Razer/Generic/LedMappings.cs | 14 +- .../Generic/RazerRGBDevice.cs | 7 +- .../Keyboard/RazerKeyboardRGBDevice.cs | 2 +- .../Mouse/RazerMouseRGBDevice.cs | 2 +- .../Native/_ChromaLinkCustomEffect.cs | 5 +- RGB.NET.Devices.Razer/Native/_Defines.cs | 5 +- .../Native/_HeadsetCustomEffect.cs | 5 +- .../Native/_KeyboardCustomEffect.cs | 5 +- .../Native/_KeypadCustomEffect.cs | 5 +- .../Native/_MouseCustomEffect.cs | 5 +- .../Native/_MousepadCustomEffect.cs | 5 +- RGB.NET.Devices.Razer/Native/_RazerSDK.cs | 7 +- .../API/Model/Event.cs | 1 + .../API/SteelSeriesSDK.cs | 6 + .../Enum/SteelSeriesLedId.cs | 4 +- .../Enum/WootingDeviceType.cs | 4 +- .../Native/_WootingDeviceInfo.cs | 5 +- RGB.NET.Layout/DeviceLayout.cs | 2 - .../Textures/Gradients/IGradient.cs | 4 +- RGB.NET.sln.DotSettings | 5 + 54 files changed, 330 insertions(+), 275 deletions(-) diff --git a/RGB.NET.Core/Color/HclColor.cs b/RGB.NET.Core/Color/HclColor.cs index 368ae8d..3adc41b 100644 --- a/RGB.NET.Core/Color/HclColor.cs +++ b/RGB.NET.Core/Color/HclColor.cs @@ -155,8 +155,8 @@ namespace RGB.NET.Core /// The color created from the values. public static Color Create(float alpha, float h, float c, float l) { - (float r, float g, float _b) = CalculateRGBFromHcl(h, c, l); - return new Color(alpha, r, g, _b); + (float r, float g, float b) = CalculateRGBFromHcl(h, c, l); + return new Color(alpha, r, g, b); } #endregion @@ -167,6 +167,7 @@ namespace RGB.NET.Core { const float RADIANS_DEGREES_CONVERSION = 180.0f / MathF.PI; + // ReSharper disable once InconsistentNaming - b is used above (float l, float a, float _b) = LabColor.CalculateLabFromRGB(r, g, b); float h, c; diff --git a/RGB.NET.Core/Color/LabColor.cs b/RGB.NET.Core/Color/LabColor.cs index 5583a79..3da5f2c 100644 --- a/RGB.NET.Core/Color/LabColor.cs +++ b/RGB.NET.Core/Color/LabColor.cs @@ -155,6 +155,7 @@ namespace RGB.NET.Core /// The color created from the values. public static Color Create(float alpha, float l, float a, float b) { + // ReSharper disable once InconsistentNaming - b is used above (float r, float g, float _b) = CalculateRGBFromLab(l, a, b); return new Color(alpha, r, g, _b); } diff --git a/RGB.NET.Core/Devices/IRGBDeviceProvider.cs b/RGB.NET.Core/Devices/IRGBDeviceProvider.cs index 5233ce9..cad53ce 100644 --- a/RGB.NET.Core/Devices/IRGBDeviceProvider.cs +++ b/RGB.NET.Core/Devices/IRGBDeviceProvider.cs @@ -1,4 +1,6 @@ -using System; +// ReSharper disable EventNeverSubscribedTo.Global + +using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/RGB.NET.Core/Extensions/PointExtensions.cs b/RGB.NET.Core/Extensions/PointExtensions.cs index cdc04f7..3fdf7a7 100644 --- a/RGB.NET.Core/Extensions/PointExtensions.cs +++ b/RGB.NET.Core/Extensions/PointExtensions.cs @@ -33,7 +33,7 @@ namespace RGB.NET.Core x = (x * cos) - (y * sin); y = (x * sin) + (y * cos); - return new Point(x + origin.X, y + origin.Y); ; + return new Point(x + origin.X, y + origin.Y); } #endregion diff --git a/RGB.NET.Core/Groups/ListLedGroup.cs b/RGB.NET.Core/Groups/ListLedGroup.cs index b6be55b..06e28ae 100644 --- a/RGB.NET.Core/Groups/ListLedGroup.cs +++ b/RGB.NET.Core/Groups/ListLedGroup.cs @@ -73,7 +73,7 @@ namespace RGB.NET.Core { lock (GroupLeds) foreach (Led led in leds) - if ((led != null) && !ContainsLed(led)) + if (!ContainsLed(led)) GroupLeds.Add(led); } @@ -91,8 +91,7 @@ namespace RGB.NET.Core { lock (GroupLeds) foreach (Led led in leds) - if (led != null) - GroupLeds.Remove(led); + GroupLeds.Remove(led); } /// diff --git a/RGB.NET.Core/Positioning/IPlaceable.cs b/RGB.NET.Core/Positioning/IPlaceable.cs index dd6d79c..d7e116f 100644 --- a/RGB.NET.Core/Positioning/IPlaceable.cs +++ b/RGB.NET.Core/Positioning/IPlaceable.cs @@ -1,4 +1,6 @@ -using System; +// ReSharper disable EventNeverSubscribedTo.Global + +using System; namespace RGB.NET.Core { diff --git a/RGB.NET.Core/Positioning/Point.cs b/RGB.NET.Core/Positioning/Point.cs index 5f04a76..588d889 100644 --- a/RGB.NET.Core/Positioning/Point.cs +++ b/RGB.NET.Core/Positioning/Point.cs @@ -1,6 +1,7 @@ // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedMember.Global +using System; using System.Diagnostics; namespace RGB.NET.Core @@ -65,9 +66,8 @@ namespace RGB.NET.Core /// true if is a equivalent to this ; otherwise, false. public override bool Equals(object? obj) { - if (!(obj is Point)) return false; + if (obj is not Point comparePoint) return false; - Point comparePoint = (Point)obj; return ((float.IsNaN(X) && float.IsNaN(comparePoint.X)) || X.EqualsInTolerance(comparePoint.X)) && ((float.IsNaN(Y) && float.IsNaN(comparePoint.Y)) || Y.EqualsInTolerance(comparePoint.Y)); } @@ -76,15 +76,7 @@ namespace RGB.NET.Core /// Returns a hash code for this . /// /// An integer value that specifies the hash code for this . - public override int GetHashCode() - { - unchecked - { - int hashCode = X.GetHashCode(); - hashCode = (hashCode * 397) ^ Y.GetHashCode(); - return hashCode; - } - } + public override int GetHashCode() => HashCode.Combine(X, Y); #endregion diff --git a/RGB.NET.Core/Rendering/Textures/PixelTexture.cs b/RGB.NET.Core/Rendering/Textures/PixelTexture.cs index 48a5f6f..f5f1719 100644 --- a/RGB.NET.Core/Rendering/Textures/PixelTexture.cs +++ b/RGB.NET.Core/Rendering/Textures/PixelTexture.cs @@ -74,7 +74,7 @@ namespace RGB.NET.Core { T[] rent = ArrayPool.Shared.Rent(bufferSize); - Span buffer = new Span(rent).Slice(0, bufferSize); + Span buffer = new Span(rent)[..bufferSize]; GetRegionData(x, y, width, height, buffer); Span pixelData = stackalloc T[_dataPerPixel]; diff --git a/RGB.NET.Core/Update/AbstractUpdateTrigger.cs b/RGB.NET.Core/Update/AbstractUpdateTrigger.cs index 127b215..10ccd52 100644 --- a/RGB.NET.Core/Update/AbstractUpdateTrigger.cs +++ b/RGB.NET.Core/Update/AbstractUpdateTrigger.cs @@ -9,6 +9,7 @@ namespace RGB.NET.Core { #region Properties & Fields + /// public abstract double LastUpdateTime { get; protected set; } #endregion diff --git a/RGB.NET.Core/Update/Devices/UpdateQueue.cs b/RGB.NET.Core/Update/Devices/UpdateQueue.cs index 9330e26..a48a1c7 100644 --- a/RGB.NET.Core/Update/Devices/UpdateQueue.cs +++ b/RGB.NET.Core/Update/Devices/UpdateQueue.cs @@ -53,7 +53,7 @@ namespace RGB.NET.Core if (_currentDataSet.Count == 0) return; dataSet = ArrayPool<(TIdentifier, TData)>.Shared.Rent(_currentDataSet.Count); - data = new Span<(TIdentifier, TData)>(dataSet).Slice(0, _currentDataSet.Count); + data = new Span<(TIdentifier, TData)>(dataSet)[.._currentDataSet.Count]; int i = 0; foreach ((TIdentifier key, TData value) in _currentDataSet) @@ -115,6 +115,8 @@ namespace RGB.NET.Core _updateTrigger.Update -= OnUpdate; Reset(); + + GC.SuppressFinalize(this); } #endregion diff --git a/RGB.NET.Core/Update/ManualUpdateTrigger.cs b/RGB.NET.Core/Update/ManualUpdateTrigger.cs index 3832570..96877cb 100644 --- a/RGB.NET.Core/Update/ManualUpdateTrigger.cs +++ b/RGB.NET.Core/Update/ManualUpdateTrigger.cs @@ -14,7 +14,7 @@ namespace RGB.NET.Core { #region Properties & Fields - private AutoResetEvent _mutex = new(false); + private readonly AutoResetEvent _mutex = new(false); private Task? UpdateTask { get; set; } private CancellationTokenSource? UpdateTokenSource { get; set; } private CancellationToken UpdateToken { get; set; } diff --git a/RGB.NET.Core/Update/TimerUpdateTrigger.cs b/RGB.NET.Core/Update/TimerUpdateTrigger.cs index e6ef02a..5a7b7e3 100644 --- a/RGB.NET.Core/Update/TimerUpdateTrigger.cs +++ b/RGB.NET.Core/Update/TimerUpdateTrigger.cs @@ -1,5 +1,6 @@ // ReSharper disable MemberCanBePrivate.Global +using System; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; @@ -14,7 +15,7 @@ namespace RGB.NET.Core { #region Properties & Fields - private object _lock = new(); + private readonly object _lock = new(); protected Task? UpdateTask { get; set; } protected CancellationTokenSource? UpdateTokenSource { get; set; } @@ -46,6 +47,7 @@ namespace RGB.NET.Core public TimerUpdateTrigger(bool autostart = true) { if (autostart) + // ReSharper disable once VirtualMemberCallInConstructor - HACK DarthAffe 01.06.2021: I've no idea how to correctly handle that case, for now just disable it Start(); } @@ -109,7 +111,11 @@ namespace RGB.NET.Core } /// - public override void Dispose() => Stop(); + public override void Dispose() + { + Stop(); + GC.SuppressFinalize(this); + } #endregion } diff --git a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs index 30fd811..24f427f 100644 --- a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs +++ b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs @@ -7,160 +7,159 @@ namespace RGB.NET.Devices.Asus /// /// A LED mapping containing ASUS keyboard LED IDs /// - public static readonly LedMapping KeyboardMapping = - new() - { - {LedId.Keyboard_Escape, AsusLedId.KEY_ESCAPE}, - {LedId.Keyboard_F1, AsusLedId.KEY_F1}, - {LedId.Keyboard_F2, AsusLedId.KEY_F2}, - {LedId.Keyboard_F3, AsusLedId.KEY_F3}, - {LedId.Keyboard_F4, AsusLedId.KEY_F4}, - {LedId.Keyboard_F5, AsusLedId.KEY_F5}, - {LedId.Keyboard_F6, AsusLedId.KEY_F6}, - {LedId.Keyboard_F7, AsusLedId.KEY_F7}, - {LedId.Keyboard_F8, AsusLedId.KEY_F8}, - {LedId.Keyboard_F9, AsusLedId.KEY_F9}, - {LedId.Keyboard_F10, AsusLedId.KEY_F10}, - {LedId.Keyboard_F11, AsusLedId.KEY_F11}, - {LedId.Keyboard_F12, AsusLedId.KEY_F12}, - {LedId.Keyboard_1, AsusLedId.KEY_1}, - {LedId.Keyboard_2, AsusLedId.KEY_2}, - {LedId.Keyboard_3, AsusLedId.KEY_3}, - {LedId.Keyboard_4, AsusLedId.KEY_4}, - {LedId.Keyboard_5, AsusLedId.KEY_5}, - {LedId.Keyboard_6, AsusLedId.KEY_6}, - {LedId.Keyboard_7, AsusLedId.KEY_7}, - {LedId.Keyboard_8, AsusLedId.KEY_8}, - {LedId.Keyboard_9, AsusLedId.KEY_9}, - {LedId.Keyboard_0, AsusLedId.KEY_0}, - {LedId.Keyboard_MinusAndUnderscore, AsusLedId.KEY_MINUS}, - {LedId.Keyboard_EqualsAndPlus, AsusLedId.KEY_EQUALS}, - {LedId.Keyboard_Backspace, AsusLedId.KEY_BACK}, - {LedId.Keyboard_Tab, AsusLedId.KEY_TAB}, - {LedId.Keyboard_Q, AsusLedId.KEY_Q}, - {LedId.Keyboard_W, AsusLedId.KEY_W}, - {LedId.Keyboard_E, AsusLedId.KEY_E}, - {LedId.Keyboard_R, AsusLedId.KEY_R}, - {LedId.Keyboard_T, AsusLedId.KEY_T}, - {LedId.Keyboard_Y, AsusLedId.KEY_Y}, - {LedId.Keyboard_U, AsusLedId.KEY_U}, - {LedId.Keyboard_I, AsusLedId.KEY_I}, - {LedId.Keyboard_O, AsusLedId.KEY_O}, - {LedId.Keyboard_P, AsusLedId.KEY_P}, - {LedId.Keyboard_BracketLeft, AsusLedId.KEY_LBRACKET}, - {LedId.Keyboard_BracketRight, AsusLedId.KEY_RBRACKET}, - {LedId.Keyboard_Enter, AsusLedId.KEY_RETURN}, - {LedId.Keyboard_CapsLock, AsusLedId.KEY_CAPITAL}, - {LedId.Keyboard_A, AsusLedId.KEY_A}, - {LedId.Keyboard_S, AsusLedId.KEY_S}, - {LedId.Keyboard_D, AsusLedId.KEY_D}, - {LedId.Keyboard_F, AsusLedId.KEY_F}, - {LedId.Keyboard_G, AsusLedId.KEY_G}, - {LedId.Keyboard_H, AsusLedId.KEY_H}, - {LedId.Keyboard_J, AsusLedId.KEY_J}, - {LedId.Keyboard_K, AsusLedId.KEY_K}, - {LedId.Keyboard_L, AsusLedId.KEY_L}, - {LedId.Keyboard_SemicolonAndColon, AsusLedId.KEY_SEMICOLON}, - {LedId.Keyboard_ApostropheAndDoubleQuote, AsusLedId.KEY_APOSTROPHE}, - {LedId.Keyboard_GraveAccentAndTilde, AsusLedId.KEY_GRAVE}, - {LedId.Keyboard_LeftShift, AsusLedId.KEY_LSHIFT}, - {LedId.Keyboard_Backslash, AsusLedId.KEY_BACKSLASH}, - {LedId.Keyboard_Z, AsusLedId.KEY_Z}, - {LedId.Keyboard_X, AsusLedId.KEY_X}, - {LedId.Keyboard_C, AsusLedId.KEY_C}, - {LedId.Keyboard_V, AsusLedId.KEY_V}, - {LedId.Keyboard_B, AsusLedId.KEY_B}, - {LedId.Keyboard_N, AsusLedId.KEY_N}, - {LedId.Keyboard_M, AsusLedId.KEY_M}, - {LedId.Keyboard_CommaAndLessThan, AsusLedId.KEY_COMMA}, - {LedId.Keyboard_PeriodAndBiggerThan, AsusLedId.KEY_PERIOD}, - {LedId.Keyboard_SlashAndQuestionMark, AsusLedId.KEY_SLASH}, - {LedId.Keyboard_RightShift, AsusLedId.KEY_RSHIFT}, - {LedId.Keyboard_LeftCtrl, AsusLedId.KEY_LCONTROL}, - {LedId.Keyboard_LeftGui, AsusLedId.KEY_LWIN}, - {LedId.Keyboard_LeftAlt, AsusLedId.KEY_LMENU}, - {LedId.Keyboard_Space, AsusLedId.KEY_SPACE}, - {LedId.Keyboard_RightAlt, AsusLedId.KEY_RMENU}, - {LedId.Keyboard_RightGui, AsusLedId.KEY_RWIN}, - {LedId.Keyboard_Application, AsusLedId.KEY_APPS}, - {LedId.Keyboard_RightCtrl, AsusLedId.KEY_RCONTROL}, - {LedId.Keyboard_PrintScreen, AsusLedId.KEY_SYSRQ}, - {LedId.Keyboard_ScrollLock, AsusLedId.KEY_SCROLL}, - {LedId.Keyboard_PauseBreak, AsusLedId.KEY_PAUSE}, - {LedId.Keyboard_Insert, AsusLedId.KEY_INSERT}, - {LedId.Keyboard_Home, AsusLedId.KEY_HOME}, - {LedId.Keyboard_PageUp, AsusLedId.KEY_PRIOR}, - {LedId.Keyboard_Delete, AsusLedId.KEY_DELETE}, - {LedId.Keyboard_End, AsusLedId.KEY_END}, - {LedId.Keyboard_PageDown, AsusLedId.KEY_NEXT}, - {LedId.Keyboard_ArrowUp, AsusLedId.KEY_UP}, - {LedId.Keyboard_ArrowLeft, AsusLedId.KEY_LEFT}, - {LedId.Keyboard_ArrowDown, AsusLedId.KEY_DOWN}, - {LedId.Keyboard_ArrowRight, AsusLedId.KEY_RIGHT}, - {LedId.Keyboard_NumLock, AsusLedId.KEY_NUMLOCK}, - {LedId.Keyboard_NumSlash, AsusLedId.KEY_DIVIDE}, - {LedId.Keyboard_NumAsterisk, AsusLedId.KEY_MULTIPLY}, - {LedId.Keyboard_NumMinus, AsusLedId.KEY_SUBTRACT}, - {LedId.Keyboard_Num7, AsusLedId.KEY_NUMPAD7}, - {LedId.Keyboard_Num8, AsusLedId.KEY_NUMPAD8}, - {LedId.Keyboard_Num9, AsusLedId.KEY_NUMPAD9}, - {LedId.Keyboard_NumPeriodAndDelete, AsusLedId.KEY_DECIMAL}, - {LedId.Keyboard_NumPlus, AsusLedId.KEY_ADD}, - {LedId.Keyboard_Num4, AsusLedId.KEY_NUMPAD4}, - {LedId.Keyboard_Num5, AsusLedId.KEY_NUMPAD5}, - {LedId.Keyboard_Num6, AsusLedId.KEY_NUMPAD6}, - {LedId.Keyboard_Num1, AsusLedId.KEY_NUMPAD1}, - {LedId.Keyboard_Num2, AsusLedId.KEY_NUMPAD2}, - {LedId.Keyboard_Num3, AsusLedId.KEY_NUMPAD3}, - {LedId.Keyboard_Num0, AsusLedId.KEY_NUMPAD0}, - {LedId.Keyboard_NumEnter, AsusLedId.KEY_NUMPADENTER}, - {LedId.Keyboard_NonUsBackslash, AsusLedId.UNDOCUMENTED_1}, - {LedId.Keyboard_NonUsTilde, AsusLedId.UNDOCUMENTED_2}, - {LedId.Keyboard_NumComma, AsusLedId.KEY_NUMPADCOMMA}, - {LedId.Logo, AsusLedId.UNDOCUMENTED_3}, - {LedId.Keyboard_Function, AsusLedId.KEY_FN}, - {LedId.Keyboard_MediaMute, AsusLedId.KEY_MUTE}, - {LedId.Keyboard_MediaPlay, AsusLedId.KEY_PLAYPAUSE}, - {LedId.Keyboard_MediaStop, AsusLedId.KEY_MEDIASTOP}, - {LedId.Keyboard_MediaVolumeDown, AsusLedId.KEY_VOLUMEDOWN}, - {LedId.Keyboard_MediaVolumeUp, AsusLedId.KEY_VOLUMEUP}, - {LedId.Keyboard_Custom1, AsusLedId.KEY_F13}, - {LedId.Keyboard_Custom2, AsusLedId.KEY_F14}, - {LedId.Keyboard_Custom3, AsusLedId.KEY_F15}, - {LedId.Keyboard_Custom4, AsusLedId.KEY_KANA}, - {LedId.Keyboard_Custom5, AsusLedId.KEY_ABNT_C1}, - {LedId.Keyboard_Custom6, AsusLedId.KEY_CONVERT}, - {LedId.Keyboard_Custom7, AsusLedId.KEY_NOCONVERT}, - {LedId.Keyboard_Custom8, AsusLedId.KEY_YEN}, - {LedId.Keyboard_Custom9, AsusLedId.KEY_ABNT_C2}, - {LedId.Keyboard_Custom10, AsusLedId.KEY_NUMPADEQUALS}, - {LedId.Keyboard_Custom11, AsusLedId.KEY_CIRCUMFLEX}, - {LedId.Keyboard_Custom12, AsusLedId.KEY_AT}, - {LedId.Keyboard_Custom13, AsusLedId.KEY_COLON}, - {LedId.Keyboard_Custom14, AsusLedId.KEY_UNDERLINE}, - {LedId.Keyboard_Custom15, AsusLedId.KEY_KANJI}, - {LedId.Keyboard_Custom16, AsusLedId.KEY_STOP}, - {LedId.Keyboard_Custom17, AsusLedId.KEY_AX}, - {LedId.Keyboard_Custom18, AsusLedId.KEY_UNLABELED}, - {LedId.Keyboard_Custom19, AsusLedId.KEY_NEXTTRACK}, - {LedId.Keyboard_Custom20, AsusLedId.KEY_CALCULATOR}, - {LedId.Keyboard_Custom21, AsusLedId.KEY_POWER}, - {LedId.Keyboard_Custom22, AsusLedId.KEY_SLEEP}, - {LedId.Keyboard_Custom23, AsusLedId.KEY_WAKE}, - {LedId.Keyboard_Custom24, AsusLedId.KEY_WEBSEARCH}, - {LedId.Keyboard_Custom25, AsusLedId.KEY_WEBFAVORITES}, - {LedId.Keyboard_Custom26, AsusLedId.KEY_WEBREFRESH}, - {LedId.Keyboard_Custom27, AsusLedId.KEY_WEBSTOP}, - {LedId.Keyboard_Custom28, AsusLedId.KEY_WEBFORWARD}, - {LedId.Keyboard_Custom29, AsusLedId.KEY_WEBHOME}, - {LedId.Keyboard_Custom30, AsusLedId.KEY_WEBBACK}, - {LedId.Keyboard_Custom31, AsusLedId.KEY_MYCOMPUTER}, - {LedId.Keyboard_Custom32, AsusLedId.KEY_MAIL}, - {LedId.Keyboard_Custom33, AsusLedId.KEY_MEDIASELECT}, - {LedId.Keyboard_Custom34, AsusLedId.UNDOCUMENTED_4}, - {LedId.Keyboard_Custom35, AsusLedId.UNDOCUMENTED_5}, - {LedId.Keyboard_Custom36, AsusLedId.UNDOCUMENTED_6} - }; + public static LedMapping KeyboardMapping { get; } = new() + { + { LedId.Keyboard_Escape, AsusLedId.KEY_ESCAPE }, + { LedId.Keyboard_F1, AsusLedId.KEY_F1 }, + { LedId.Keyboard_F2, AsusLedId.KEY_F2 }, + { LedId.Keyboard_F3, AsusLedId.KEY_F3 }, + { LedId.Keyboard_F4, AsusLedId.KEY_F4 }, + { LedId.Keyboard_F5, AsusLedId.KEY_F5 }, + { LedId.Keyboard_F6, AsusLedId.KEY_F6 }, + { LedId.Keyboard_F7, AsusLedId.KEY_F7 }, + { LedId.Keyboard_F8, AsusLedId.KEY_F8 }, + { LedId.Keyboard_F9, AsusLedId.KEY_F9 }, + { LedId.Keyboard_F10, AsusLedId.KEY_F10 }, + { LedId.Keyboard_F11, AsusLedId.KEY_F11 }, + { LedId.Keyboard_F12, AsusLedId.KEY_F12 }, + { LedId.Keyboard_1, AsusLedId.KEY_1 }, + { LedId.Keyboard_2, AsusLedId.KEY_2 }, + { LedId.Keyboard_3, AsusLedId.KEY_3 }, + { LedId.Keyboard_4, AsusLedId.KEY_4 }, + { LedId.Keyboard_5, AsusLedId.KEY_5 }, + { LedId.Keyboard_6, AsusLedId.KEY_6 }, + { LedId.Keyboard_7, AsusLedId.KEY_7 }, + { LedId.Keyboard_8, AsusLedId.KEY_8 }, + { LedId.Keyboard_9, AsusLedId.KEY_9 }, + { LedId.Keyboard_0, AsusLedId.KEY_0 }, + { LedId.Keyboard_MinusAndUnderscore, AsusLedId.KEY_MINUS }, + { LedId.Keyboard_EqualsAndPlus, AsusLedId.KEY_EQUALS }, + { LedId.Keyboard_Backspace, AsusLedId.KEY_BACK }, + { LedId.Keyboard_Tab, AsusLedId.KEY_TAB }, + { LedId.Keyboard_Q, AsusLedId.KEY_Q }, + { LedId.Keyboard_W, AsusLedId.KEY_W }, + { LedId.Keyboard_E, AsusLedId.KEY_E }, + { LedId.Keyboard_R, AsusLedId.KEY_R }, + { LedId.Keyboard_T, AsusLedId.KEY_T }, + { LedId.Keyboard_Y, AsusLedId.KEY_Y }, + { LedId.Keyboard_U, AsusLedId.KEY_U }, + { LedId.Keyboard_I, AsusLedId.KEY_I }, + { LedId.Keyboard_O, AsusLedId.KEY_O }, + { LedId.Keyboard_P, AsusLedId.KEY_P }, + { LedId.Keyboard_BracketLeft, AsusLedId.KEY_LBRACKET }, + { LedId.Keyboard_BracketRight, AsusLedId.KEY_RBRACKET }, + { LedId.Keyboard_Enter, AsusLedId.KEY_RETURN }, + { LedId.Keyboard_CapsLock, AsusLedId.KEY_CAPITAL }, + { LedId.Keyboard_A, AsusLedId.KEY_A }, + { LedId.Keyboard_S, AsusLedId.KEY_S }, + { LedId.Keyboard_D, AsusLedId.KEY_D }, + { LedId.Keyboard_F, AsusLedId.KEY_F }, + { LedId.Keyboard_G, AsusLedId.KEY_G }, + { LedId.Keyboard_H, AsusLedId.KEY_H }, + { LedId.Keyboard_J, AsusLedId.KEY_J }, + { LedId.Keyboard_K, AsusLedId.KEY_K }, + { LedId.Keyboard_L, AsusLedId.KEY_L }, + { LedId.Keyboard_SemicolonAndColon, AsusLedId.KEY_SEMICOLON }, + { LedId.Keyboard_ApostropheAndDoubleQuote, AsusLedId.KEY_APOSTROPHE }, + { LedId.Keyboard_GraveAccentAndTilde, AsusLedId.KEY_GRAVE }, + { LedId.Keyboard_LeftShift, AsusLedId.KEY_LSHIFT }, + { LedId.Keyboard_Backslash, AsusLedId.KEY_BACKSLASH }, + { LedId.Keyboard_Z, AsusLedId.KEY_Z }, + { LedId.Keyboard_X, AsusLedId.KEY_X }, + { LedId.Keyboard_C, AsusLedId.KEY_C }, + { LedId.Keyboard_V, AsusLedId.KEY_V }, + { LedId.Keyboard_B, AsusLedId.KEY_B }, + { LedId.Keyboard_N, AsusLedId.KEY_N }, + { LedId.Keyboard_M, AsusLedId.KEY_M }, + { LedId.Keyboard_CommaAndLessThan, AsusLedId.KEY_COMMA }, + { LedId.Keyboard_PeriodAndBiggerThan, AsusLedId.KEY_PERIOD }, + { LedId.Keyboard_SlashAndQuestionMark, AsusLedId.KEY_SLASH }, + { LedId.Keyboard_RightShift, AsusLedId.KEY_RSHIFT }, + { LedId.Keyboard_LeftCtrl, AsusLedId.KEY_LCONTROL }, + { LedId.Keyboard_LeftGui, AsusLedId.KEY_LWIN }, + { LedId.Keyboard_LeftAlt, AsusLedId.KEY_LMENU }, + { LedId.Keyboard_Space, AsusLedId.KEY_SPACE }, + { LedId.Keyboard_RightAlt, AsusLedId.KEY_RMENU }, + { LedId.Keyboard_RightGui, AsusLedId.KEY_RWIN }, + { LedId.Keyboard_Application, AsusLedId.KEY_APPS }, + { LedId.Keyboard_RightCtrl, AsusLedId.KEY_RCONTROL }, + { LedId.Keyboard_PrintScreen, AsusLedId.KEY_SYSRQ }, + { LedId.Keyboard_ScrollLock, AsusLedId.KEY_SCROLL }, + { LedId.Keyboard_PauseBreak, AsusLedId.KEY_PAUSE }, + { LedId.Keyboard_Insert, AsusLedId.KEY_INSERT }, + { LedId.Keyboard_Home, AsusLedId.KEY_HOME }, + { LedId.Keyboard_PageUp, AsusLedId.KEY_PRIOR }, + { LedId.Keyboard_Delete, AsusLedId.KEY_DELETE }, + { LedId.Keyboard_End, AsusLedId.KEY_END }, + { LedId.Keyboard_PageDown, AsusLedId.KEY_NEXT }, + { LedId.Keyboard_ArrowUp, AsusLedId.KEY_UP }, + { LedId.Keyboard_ArrowLeft, AsusLedId.KEY_LEFT }, + { LedId.Keyboard_ArrowDown, AsusLedId.KEY_DOWN }, + { LedId.Keyboard_ArrowRight, AsusLedId.KEY_RIGHT }, + { LedId.Keyboard_NumLock, AsusLedId.KEY_NUMLOCK }, + { LedId.Keyboard_NumSlash, AsusLedId.KEY_DIVIDE }, + { LedId.Keyboard_NumAsterisk, AsusLedId.KEY_MULTIPLY }, + { LedId.Keyboard_NumMinus, AsusLedId.KEY_SUBTRACT }, + { LedId.Keyboard_Num7, AsusLedId.KEY_NUMPAD7 }, + { LedId.Keyboard_Num8, AsusLedId.KEY_NUMPAD8 }, + { LedId.Keyboard_Num9, AsusLedId.KEY_NUMPAD9 }, + { LedId.Keyboard_NumPeriodAndDelete, AsusLedId.KEY_DECIMAL }, + { LedId.Keyboard_NumPlus, AsusLedId.KEY_ADD }, + { LedId.Keyboard_Num4, AsusLedId.KEY_NUMPAD4 }, + { LedId.Keyboard_Num5, AsusLedId.KEY_NUMPAD5 }, + { LedId.Keyboard_Num6, AsusLedId.KEY_NUMPAD6 }, + { LedId.Keyboard_Num1, AsusLedId.KEY_NUMPAD1 }, + { LedId.Keyboard_Num2, AsusLedId.KEY_NUMPAD2 }, + { LedId.Keyboard_Num3, AsusLedId.KEY_NUMPAD3 }, + { LedId.Keyboard_Num0, AsusLedId.KEY_NUMPAD0 }, + { LedId.Keyboard_NumEnter, AsusLedId.KEY_NUMPADENTER }, + { LedId.Keyboard_NonUsBackslash, AsusLedId.UNDOCUMENTED_1 }, + { LedId.Keyboard_NonUsTilde, AsusLedId.UNDOCUMENTED_2 }, + { LedId.Keyboard_NumComma, AsusLedId.KEY_NUMPADCOMMA }, + { LedId.Logo, AsusLedId.UNDOCUMENTED_3 }, + { LedId.Keyboard_Function, AsusLedId.KEY_FN }, + { LedId.Keyboard_MediaMute, AsusLedId.KEY_MUTE }, + { LedId.Keyboard_MediaPlay, AsusLedId.KEY_PLAYPAUSE }, + { LedId.Keyboard_MediaStop, AsusLedId.KEY_MEDIASTOP }, + { LedId.Keyboard_MediaVolumeDown, AsusLedId.KEY_VOLUMEDOWN }, + { LedId.Keyboard_MediaVolumeUp, AsusLedId.KEY_VOLUMEUP }, + { LedId.Keyboard_Custom1, AsusLedId.KEY_F13 }, + { LedId.Keyboard_Custom2, AsusLedId.KEY_F14 }, + { LedId.Keyboard_Custom3, AsusLedId.KEY_F15 }, + { LedId.Keyboard_Custom4, AsusLedId.KEY_KANA }, + { LedId.Keyboard_Custom5, AsusLedId.KEY_ABNT_C1 }, + { LedId.Keyboard_Custom6, AsusLedId.KEY_CONVERT }, + { LedId.Keyboard_Custom7, AsusLedId.KEY_NOCONVERT }, + { LedId.Keyboard_Custom8, AsusLedId.KEY_YEN }, + { LedId.Keyboard_Custom9, AsusLedId.KEY_ABNT_C2 }, + { LedId.Keyboard_Custom10, AsusLedId.KEY_NUMPADEQUALS }, + { LedId.Keyboard_Custom11, AsusLedId.KEY_CIRCUMFLEX }, + { LedId.Keyboard_Custom12, AsusLedId.KEY_AT }, + { LedId.Keyboard_Custom13, AsusLedId.KEY_COLON }, + { LedId.Keyboard_Custom14, AsusLedId.KEY_UNDERLINE }, + { LedId.Keyboard_Custom15, AsusLedId.KEY_KANJI }, + { LedId.Keyboard_Custom16, AsusLedId.KEY_STOP }, + { LedId.Keyboard_Custom17, AsusLedId.KEY_AX }, + { LedId.Keyboard_Custom18, AsusLedId.KEY_UNLABELED }, + { LedId.Keyboard_Custom19, AsusLedId.KEY_NEXTTRACK }, + { LedId.Keyboard_Custom20, AsusLedId.KEY_CALCULATOR }, + { LedId.Keyboard_Custom21, AsusLedId.KEY_POWER }, + { LedId.Keyboard_Custom22, AsusLedId.KEY_SLEEP }, + { LedId.Keyboard_Custom23, AsusLedId.KEY_WAKE }, + { LedId.Keyboard_Custom24, AsusLedId.KEY_WEBSEARCH }, + { LedId.Keyboard_Custom25, AsusLedId.KEY_WEBFAVORITES }, + { LedId.Keyboard_Custom26, AsusLedId.KEY_WEBREFRESH }, + { LedId.Keyboard_Custom27, AsusLedId.KEY_WEBSTOP }, + { LedId.Keyboard_Custom28, AsusLedId.KEY_WEBFORWARD }, + { LedId.Keyboard_Custom29, AsusLedId.KEY_WEBHOME }, + { LedId.Keyboard_Custom30, AsusLedId.KEY_WEBBACK }, + { LedId.Keyboard_Custom31, AsusLedId.KEY_MYCOMPUTER }, + { LedId.Keyboard_Custom32, AsusLedId.KEY_MAIL }, + { LedId.Keyboard_Custom33, AsusLedId.KEY_MEDIASELECT }, + { LedId.Keyboard_Custom34, AsusLedId.UNDOCUMENTED_4 }, + { LedId.Keyboard_Custom35, AsusLedId.UNDOCUMENTED_5 }, + { LedId.Keyboard_Custom36, AsusLedId.UNDOCUMENTED_6 } + }; /// /// A LED mapping containing extra lights for the ROG Zephyrus Duo 15 @@ -170,20 +169,19 @@ namespace RGB.NET.Devices.Asus /// /// You may add more of these by further populating . /// - public static readonly LedMapping ROGZephyrusDuo15 = - new() - { - {LedId.Keyboard_Custom50, 39}, // Mapping starts at Custom50 to avoid possible conflicts with KeyboardMapping above - {LedId.Keyboard_Custom51, 40}, - {LedId.Keyboard_Custom52, 55}, - {LedId.Keyboard_Custom53, 57}, - {LedId.Keyboard_Custom54, 97}, - {LedId.Keyboard_Custom55, 99}, - {LedId.Keyboard_Custom56, 118}, - {LedId.Keyboard_Custom57, 120}, - {LedId.Keyboard_Custom58, 130}, - {LedId.Keyboard_Custom59, 131}, - {LedId.Keyboard_Custom60, 133}, - }; + public static LedMapping ROGZephyrusDuo15 { get; } = new() + { + { LedId.Keyboard_Custom50, 39 }, // Mapping starts at Custom50 to avoid possible conflicts with KeyboardMapping above + { LedId.Keyboard_Custom51, 40 }, + { LedId.Keyboard_Custom52, 55 }, + { LedId.Keyboard_Custom53, 57 }, + { LedId.Keyboard_Custom54, 97 }, + { LedId.Keyboard_Custom55, 99 }, + { LedId.Keyboard_Custom56, 118 }, + { LedId.Keyboard_Custom57, 120 }, + { LedId.Keyboard_Custom58, 130 }, + { LedId.Keyboard_Custom59, 131 }, + { LedId.Keyboard_Custom60, 133 }, + }; } } diff --git a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs index 0301934..f5074e6 100644 --- a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs @@ -15,7 +15,7 @@ namespace RGB.NET.Devices.Asus /// The ASUS SDK returns useless names for notebook keyboards, possibly for others as well. /// Keep a list of those and rely on to get the real model /// - private static List GenericDeviceNames = new() {"NotebookKeyboard"}; + private static readonly List GENERIC_DEVICE_NAMES = new() { "NotebookKeyboard" }; /// public KeyboardLayoutType Layout => KeyboardLayoutType.Unknown; @@ -37,10 +37,7 @@ namespace RGB.NET.Devices.Asus #region Methods - private static string? GetKeyboardModel(string deviceName) - { - return GenericDeviceNames.Contains(deviceName) ? WMIHelper.GetSystemModelInfo() : deviceName; - } + private static string? GetKeyboardModel(string deviceName) => GENERIC_DEVICE_NAMES.Contains(deviceName) ? WMIHelper.GetSystemModelInfo() : deviceName; #endregion } diff --git a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs index 4e868b4..3efe8eb 100644 --- a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs +++ b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs @@ -44,7 +44,7 @@ namespace RGB.NET.Devices.CoolerMaster this.DeviceType = deviceType; this.DeviceIndex = deviceIndex; - Model = deviceIndex.GetDescription() ?? "Unknown"; + Model = deviceIndex.GetDescription(); DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model); } diff --git a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs index 42c96fe..7851bd3 100644 --- a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs +++ b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs @@ -12,7 +12,7 @@ namespace RGB.NET.Devices.CoolerMaster { #region Properties & Fields - private CoolerMasterDevicesIndexes _deviceIndex; + private readonly CoolerMasterDevicesIndexes _deviceIndex; private readonly _CoolerMasterColorMatrix _deviceMatrix; #endregion @@ -29,8 +29,7 @@ namespace RGB.NET.Devices.CoolerMaster { this._deviceIndex = deviceIndex; - _deviceMatrix = new _CoolerMasterColorMatrix(); - _deviceMatrix.KeyColor = new _CoolerMasterKeyColor[_CoolerMasterColorMatrix.ROWS, _CoolerMasterColorMatrix.COLUMNS]; + _deviceMatrix = new _CoolerMasterColorMatrix { KeyColor = new _CoolerMasterKeyColor[_CoolerMasterColorMatrix.ROWS, _CoolerMasterColorMatrix.COLUMNS] }; } #endregion diff --git a/RGB.NET.Devices.CoolerMaster/Helper/EnumExtension.cs b/RGB.NET.Devices.CoolerMaster/Helper/EnumExtension.cs index 9cd05ce..63e9479 100644 --- a/RGB.NET.Devices.CoolerMaster/Helper/EnumExtension.cs +++ b/RGB.NET.Devices.CoolerMaster/Helper/EnumExtension.cs @@ -15,7 +15,7 @@ namespace RGB.NET.Devices.CoolerMaster.Helper /// /// The enum value to get the description from. /// The value of the or the result of the source. - internal static string? GetDescription(this Enum source) + internal static string GetDescription(this Enum source) => source.GetAttribute()?.Description ?? source.ToString(); /// diff --git a/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs b/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs index aa4c3aa..f67d587 100644 --- a/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs +++ b/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs @@ -18,7 +18,9 @@ namespace RGB.NET.Devices.CoolerMaster /// The specific information provided by CoolerMaster for the mouse internal CoolerMasterMouseRGBDevice(CoolerMasterMouseRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) - { } + { + InitializeLayout(); + } #endregion diff --git a/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs b/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs index 28f5776..bb05b71 100644 --- a/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs +++ b/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs @@ -1,4 +1,5 @@ -// ReSharper disable UnusedMethodReturnValue.Global +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable UnusedMethodReturnValue.Global // ReSharper disable UnusedMember.Global using System; @@ -53,13 +54,10 @@ namespace RGB.NET.Devices.CoolerMaster.Native _setAllLedColorPointer = (SetAllLedColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetAllLedColor"), typeof(SetAllLedColorPointer)); } - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr LoadLibrary(string dllToLoad); - - [DllImport("kernel32.dll")] - private static extern bool FreeLibrary(IntPtr dllHandle); - - [DllImport("kernel32.dll")] + + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs index 8884945..33fcd75 100644 --- a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs +++ b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs @@ -80,7 +80,7 @@ namespace RGB.NET.Devices.Corsair // DarthAffe 02.02.2021: 127 is iCUE if (!_CUESDK.CorsairSetLayerPriority(128)) - Throw(new CUEException(LastError), false); + Throw(new CUEException(LastError)); } /// diff --git a/RGB.NET.Devices.Corsair/Native/_CUESDK.cs b/RGB.NET.Devices.Corsair/Native/_CUESDK.cs index b10feb0..05483a5 100644 --- a/RGB.NET.Devices.Corsair/Native/_CUESDK.cs +++ b/RGB.NET.Devices.Corsair/Native/_CUESDK.cs @@ -1,4 +1,5 @@ -// ReSharper disable UnusedMethodReturnValue.Global +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable UnusedMethodReturnValue.Global // ReSharper disable UnusedMember.Global using System; @@ -61,13 +62,13 @@ namespace RGB.NET.Devices.Corsair.Native _dllHandle = IntPtr.Zero; } - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.Corsair/Native/_CorsairLedColor.cs b/RGB.NET.Devices.Corsair/Native/_CorsairLedColor.cs index 349b6c1..429e7c0 100644 --- a/RGB.NET.Devices.Corsair/Native/_CorsairLedColor.cs +++ b/RGB.NET.Devices.Corsair/Native/_CorsairLedColor.cs @@ -1,6 +1,8 @@ #pragma warning disable 169 // Field 'x' is never used #pragma warning disable 414 // Field 'x' is assigned but its value never used #pragma warning disable 649 // Field 'x' is never assigned +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable NotAccessedField.Global using System.Runtime.InteropServices; diff --git a/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs b/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs index e7a3f96..c99e7c4 100644 --- a/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs +++ b/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs @@ -15,7 +15,7 @@ namespace RGB.NET.Devices.DMX.E131 /// /// The UDP-Connection used to send data. /// - private UdpClient _socket; + private readonly UdpClient _socket; /// /// Gets the byte-representation of a E1.31 packet as described in http://tsp.esta.org/tsp/documents/docs/E1-31-2016.pdf. @@ -26,7 +26,7 @@ namespace RGB.NET.Devices.DMX.E131 /// /// The sequence-number used to detect the order in which packages where sent. /// - private byte _sequenceNumber = 0; + private byte _sequenceNumber; #endregion diff --git a/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs b/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs index b879ab4..799ab70 100644 --- a/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs +++ b/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs @@ -1,4 +1,4 @@ -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member +// ReSharper disable InconsistentNaming namespace RGB.NET.Devices.Logitech { diff --git a/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs b/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs index 0fc08e8..661dd83 100644 --- a/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs +++ b/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs @@ -140,10 +140,10 @@ namespace RGB.NET.Devices.Logitech //TODO DarthAffe 04.03.2021: Rework device selection and configuration for HID-based providers protected override IEnumerable LoadDevices() { - IEnumerable<(HIDDeviceDefinition definition, HidDevice device)> perKeyDevices = PerKeyDeviceDefinitions.GetConnectedDevices(); - if ((_perKeyUpdateQueue != null) && perKeyDevices.Any()) + (HIDDeviceDefinition definition, HidDevice device) perKeyDevice = PerKeyDeviceDefinitions.GetConnectedDevices().FirstOrDefault(); + if ((_perKeyUpdateQueue != null) && (perKeyDevice != default)) { - (HIDDeviceDefinition definition, _) = perKeyDevices.First(); + (HIDDeviceDefinition definition, _) = perKeyDevice; yield return new LogitechPerKeyRGBDevice(new LogitechRGBDeviceInfo(definition.DeviceType, definition.Name, LogitechDeviceCaps.PerKeyRGB, 0), _perKeyUpdateQueue, definition.LedMapping); } @@ -154,10 +154,10 @@ namespace RGB.NET.Devices.Logitech yield return new LogitechZoneRGBDevice(new LogitechRGBDeviceInfo(definition.DeviceType, definition.Name, LogitechDeviceCaps.DeviceRGB, definition.CustomData.zones), updateQueue, definition.LedMapping); } - IEnumerable<(HIDDeviceDefinition definition, HidDevice device)> perDeviceDevices = PerDeviceDeviceDefinitions.GetConnectedDevices(); - if ((_perDeviceUpdateQueue != null) && perDeviceDevices.Any()) + (HIDDeviceDefinition definition, HidDevice device) perDeviceDevice = PerDeviceDeviceDefinitions.GetConnectedDevices().FirstOrDefault(); + if ((_perDeviceUpdateQueue != null) && (perDeviceDevice != default)) { - (HIDDeviceDefinition definition, _) = perDeviceDevices.First(); + (HIDDeviceDefinition definition, _) = perDeviceDevice; yield return new LogitechPerDeviceRGBDevice(new LogitechRGBDeviceInfo(definition.DeviceType, definition.Name, LogitechDeviceCaps.DeviceRGB, 0), _perDeviceUpdateQueue, definition.LedMapping); } } @@ -172,6 +172,8 @@ namespace RGB.NET.Devices.Logitech try { _LogitechGSDK.UnloadLogitechGSDK(); } catch { /* at least we tried */ } + + GC.SuppressFinalize(this); } #endregion diff --git a/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs b/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs index ebec0c7..1f34dab 100644 --- a/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs +++ b/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs @@ -1,4 +1,5 @@ -// ReSharper disable UnusedMethodReturnValue.Global +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable UnusedMethodReturnValue.Global // ReSharper disable UnusedMember.Global // ReSharper disable MemberCanBePrivate.Global @@ -62,13 +63,13 @@ namespace RGB.NET.Devices.Logitech.Native _dllHandle = IntPtr.Zero; } - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.Logitech/Zone/LogitechZoneRGBDevice.cs b/RGB.NET.Devices.Logitech/Zone/LogitechZoneRGBDevice.cs index c4c18b3..2563a2b 100644 --- a/RGB.NET.Devices.Logitech/Zone/LogitechZoneRGBDevice.cs +++ b/RGB.NET.Devices.Logitech/Zone/LogitechZoneRGBDevice.cs @@ -40,7 +40,7 @@ namespace RGB.NET.Devices.Logitech } /// - protected override object? GetLedCustomData(LedId ledId) => _ledMapping[ledId]; + protected override object GetLedCustomData(LedId ledId) => _ledMapping[ledId]; /// protected override void UpdateLeds(IEnumerable ledsToUpdate) => UpdateQueue.SetData(GetUpdateData(ledsToUpdate)); diff --git a/RGB.NET.Devices.Msi/Native/_MsiSDK.cs b/RGB.NET.Devices.Msi/Native/_MsiSDK.cs index e5c0700..faa9dfe 100644 --- a/RGB.NET.Devices.Msi/Native/_MsiSDK.cs +++ b/RGB.NET.Devices.Msi/Native/_MsiSDK.cs @@ -1,4 +1,5 @@ -// ReSharper disable UnusedMethodReturnValue.Global +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable UnusedMethodReturnValue.Global // ReSharper disable UnusedMember.Global using System; @@ -65,16 +66,16 @@ namespace RGB.NET.Devices.Msi.Native _dllHandle = IntPtr.Zero; } - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern bool SetDllDirectory(string lpPathName); - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs b/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs index 959e360..c468ccd 100644 --- a/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs +++ b/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs @@ -41,16 +41,13 @@ namespace RGB.NET.Devices.Novation { (double hue, double _, double value) = color.GetHSV(); - if ((hue >= 330) || (hue < 30)) - return (int)Math.Ceiling(value * 3); // red with brightness 1, 2 or 3 - - if ((hue >= 30) && (hue < 90)) // yellow with brightness 17, 34 or 51 - return (int)Math.Ceiling(value * 3) * 17; - - if ((hue >= 90) && (hue < 150)) // green with brightness 16, 32 or 48 - return (int)Math.Ceiling(value * 3) * 16; - - return 0; + return hue switch + { + >= 330 or < 30 => (int)Math.Ceiling(value * 3), // red with brightness 1, 2 or 3 + >= 30 and < 90 => (int)Math.Ceiling(value * 3) * 17, // yellow with brightness 17, 34 or 51 + >= 90 and < 150 => (int)Math.Ceiling(value * 3) * 16, // green with brightness 16, 32 or 48 + _ => 0 + }; } /// diff --git a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs index f29241b..9c39612 100644 --- a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs +++ b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs @@ -5,11 +5,10 @@ using Sanford.Multimedia.Midi; namespace RGB.NET.Devices.Novation { /// - /// /// /// Represents the update-queue performing updates for midi devices. /// - public abstract class MidiUpdateQueue : UpdateQueue, IDisposable + public abstract class MidiUpdateQueue : UpdateQueue { #region Properties & Fields @@ -66,6 +65,8 @@ namespace RGB.NET.Devices.Novation base.Dispose(); _outputDevice.Dispose(); + + GC.SuppressFinalize(this); } #endregion diff --git a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs index 6be8738..1b9f073 100644 --- a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs +++ b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs @@ -40,7 +40,9 @@ namespace RGB.NET.Devices.Novation } /// + // ReSharper disable RedundantCast protected override object GetLedCustomData(LedId ledId) => GetDeviceMapping().TryGetValue(ledId, out (byte mode, byte id, int _, int __) data) ? (data.mode, data.id) : ((byte)0x00, (byte)0x00); + // ReSharper restore RedundantCast protected virtual Dictionary GetDeviceMapping() => DeviceInfo.LedIdMapping switch diff --git a/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs b/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs index 6be450c..99b0ff0 100644 --- a/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs +++ b/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs @@ -1,4 +1,6 @@ -namespace RGB.NET.Devices.PicoPi.Enum +// ReSharper disable InconsistentNaming + +namespace RGB.NET.Devices.PicoPi.Enum { public enum UpdateMode { diff --git a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs index 8c61776..f3a8248 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs @@ -38,7 +38,7 @@ namespace RGB.NET.Devices.PicoPi private readonly byte[] _hidSendBuffer; private readonly byte[] _bulkSendBuffer; - private int _bulkTransferLength = 0; + private int _bulkTransferLength; public bool IsBulkSupported { get; private set; } @@ -181,7 +181,7 @@ namespace RGB.NET.Devices.PicoPi { if ((data.Length == 0) || !IsBulkSupported) return; - Span sendBuffer = new Span(_bulkSendBuffer).Slice(2); + Span sendBuffer = new Span(_bulkSendBuffer)[2..]; int payloadSize = data.Length; sendBuffer[_bulkTransferLength++] = (byte)((channel << 4) | COMMAND_UPDATE_BULK); @@ -212,6 +212,8 @@ namespace RGB.NET.Devices.PicoPi _hidStream.Dispose(); _bulkDevice?.Dispose(); _usbContext?.Dispose(); + + GC.SuppressFinalize(this); } #endregion diff --git a/RGB.NET.Devices.Razer/Enum/RazerError.cs b/RGB.NET.Devices.Razer/Enum/RazerError.cs index 3400792..4ee6a39 100644 --- a/RGB.NET.Devices.Razer/Enum/RazerError.cs +++ b/RGB.NET.Devices.Razer/Enum/RazerError.cs @@ -3,7 +3,7 @@ /// /// Razer-SDK: Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. /// - public enum RazerError : int + public enum RazerError { /// /// Razer-SDK: Invalid. diff --git a/RGB.NET.Devices.Razer/Generic/LedMappings.cs b/RGB.NET.Devices.Razer/Generic/LedMappings.cs index a71e91f..d136b54 100644 --- a/RGB.NET.Devices.Razer/Generic/LedMappings.cs +++ b/RGB.NET.Devices.Razer/Generic/LedMappings.cs @@ -5,7 +5,7 @@ namespace RGB.NET.Devices.Razer { public static class LedMappings { - public static readonly LedMapping Keyboard = new() + public static LedMapping Keyboard { get; } = new() { //Row 0 is empty @@ -154,7 +154,7 @@ namespace RGB.NET.Devices.Razer //Row 7 is also empty }; - public static readonly LedMapping LaptopKeyboard = new() + public static LedMapping LaptopKeyboard { get; } = new() { //Row 0 is empty @@ -272,7 +272,7 @@ namespace RGB.NET.Devices.Razer //Row 7 is also empty }; - public static readonly LedMapping Mouse = new() + public static LedMapping Mouse { get; } = new() { //row 0 empty @@ -316,12 +316,12 @@ namespace RGB.NET.Devices.Razer }; //TODO DarthAffe 27.04.2021: Are mappings for these possible? - public static readonly LedMapping Mousepad = new(); + public static LedMapping Mousepad { get; } = new(); - public static readonly LedMapping Headset = new(); + public static LedMapping Headset { get; } = new(); - public static readonly LedMapping Keypad = new(); + public static LedMapping Keypad { get; } = new(); - public static readonly LedMapping ChromaLink = new(); + public static LedMapping ChromaLink { get; } = new(); } } diff --git a/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs b/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs index 7b516dd..6a7208c 100644 --- a/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using RGB.NET.Core; namespace RGB.NET.Devices.Razer @@ -32,10 +33,12 @@ namespace RGB.NET.Devices.Razer /// public override void Dispose() { - try { UpdateQueue?.Dispose(); } + try { UpdateQueue.Dispose(); } catch { /* at least we tried */ } base.Dispose(); + + GC.SuppressFinalize(this); } #endregion diff --git a/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs b/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs index b15a948..2d17914 100644 --- a/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs @@ -48,7 +48,7 @@ namespace RGB.NET.Devices.Razer } /// - protected override object? GetLedCustomData(LedId ledId) => _ledMapping[ledId]; + protected override object GetLedCustomData(LedId ledId) => _ledMapping[ledId]; #endregion } diff --git a/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs b/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs index 6513b40..eec4dab 100644 --- a/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs @@ -46,7 +46,7 @@ namespace RGB.NET.Devices.Razer } /// - protected override object? GetLedCustomData(LedId ledId) => _ledMapping[ledId]; + protected override object GetLedCustomData(LedId ledId) => _ledMapping[ledId]; #endregion } diff --git a/RGB.NET.Devices.Razer/Native/_ChromaLinkCustomEffect.cs b/RGB.NET.Devices.Razer/Native/_ChromaLinkCustomEffect.cs index 267dbe0..e1e77d0 100644 --- a/RGB.NET.Devices.Razer/Native/_ChromaLinkCustomEffect.cs +++ b/RGB.NET.Devices.Razer/Native/_ChromaLinkCustomEffect.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +using System.Runtime.InteropServices; namespace RGB.NET.Devices.Razer.Native { diff --git a/RGB.NET.Devices.Razer/Native/_Defines.cs b/RGB.NET.Devices.Razer/Native/_Defines.cs index 9db44a2..835c2b4 100644 --- a/RGB.NET.Devices.Razer/Native/_Defines.cs +++ b/RGB.NET.Devices.Razer/Native/_Defines.cs @@ -1,4 +1,7 @@ -namespace RGB.NET.Devices.Razer.Native +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +namespace RGB.NET.Devices.Razer.Native { internal static class _Defines { diff --git a/RGB.NET.Devices.Razer/Native/_HeadsetCustomEffect.cs b/RGB.NET.Devices.Razer/Native/_HeadsetCustomEffect.cs index d3bcdb3..911198f 100644 --- a/RGB.NET.Devices.Razer/Native/_HeadsetCustomEffect.cs +++ b/RGB.NET.Devices.Razer/Native/_HeadsetCustomEffect.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +using System.Runtime.InteropServices; namespace RGB.NET.Devices.Razer.Native { diff --git a/RGB.NET.Devices.Razer/Native/_KeyboardCustomEffect.cs b/RGB.NET.Devices.Razer/Native/_KeyboardCustomEffect.cs index 0cef396..0515865 100644 --- a/RGB.NET.Devices.Razer/Native/_KeyboardCustomEffect.cs +++ b/RGB.NET.Devices.Razer/Native/_KeyboardCustomEffect.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +using System.Runtime.InteropServices; namespace RGB.NET.Devices.Razer.Native { diff --git a/RGB.NET.Devices.Razer/Native/_KeypadCustomEffect.cs b/RGB.NET.Devices.Razer/Native/_KeypadCustomEffect.cs index a08a175..657d6ca 100644 --- a/RGB.NET.Devices.Razer/Native/_KeypadCustomEffect.cs +++ b/RGB.NET.Devices.Razer/Native/_KeypadCustomEffect.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +using System.Runtime.InteropServices; namespace RGB.NET.Devices.Razer.Native { diff --git a/RGB.NET.Devices.Razer/Native/_MouseCustomEffect.cs b/RGB.NET.Devices.Razer/Native/_MouseCustomEffect.cs index a5e1599..488cc53 100644 --- a/RGB.NET.Devices.Razer/Native/_MouseCustomEffect.cs +++ b/RGB.NET.Devices.Razer/Native/_MouseCustomEffect.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +using System.Runtime.InteropServices; namespace RGB.NET.Devices.Razer.Native { diff --git a/RGB.NET.Devices.Razer/Native/_MousepadCustomEffect.cs b/RGB.NET.Devices.Razer/Native/_MousepadCustomEffect.cs index 01368bf..24ee8c1 100644 --- a/RGB.NET.Devices.Razer/Native/_MousepadCustomEffect.cs +++ b/RGB.NET.Devices.Razer/Native/_MousepadCustomEffect.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +using System.Runtime.InteropServices; namespace RGB.NET.Devices.Razer.Native { diff --git a/RGB.NET.Devices.Razer/Native/_RazerSDK.cs b/RGB.NET.Devices.Razer/Native/_RazerSDK.cs index 47d9b18..cd377e1 100644 --- a/RGB.NET.Devices.Razer/Native/_RazerSDK.cs +++ b/RGB.NET.Devices.Razer/Native/_RazerSDK.cs @@ -1,4 +1,5 @@ -// ReSharper disable UnusedMethodReturnValue.Global +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable UnusedMethodReturnValue.Global // ReSharper disable UnusedMember.Global using System; @@ -61,13 +62,13 @@ namespace RGB.NET.Devices.Razer.Native _dllHandle = IntPtr.Zero; } - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr LoadLibrary(string dllToLoad); [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.SteelSeries/API/Model/Event.cs b/RGB.NET.Devices.SteelSeries/API/Model/Event.cs index 0a7935c..13894be 100644 --- a/RGB.NET.Devices.SteelSeries/API/Model/Event.cs +++ b/RGB.NET.Devices.SteelSeries/API/Model/Event.cs @@ -13,6 +13,7 @@ namespace RGB.NET.Devices.SteelSeries.API.Model [JsonPropertyName("event")] public string? Name { get; set; } + // ReSharper disable once CollectionNeverQueried.Global [JsonPropertyName("data")] public Dictionary Data { get; } = new(); diff --git a/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs b/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs index 4d36107..49d5b6b 100644 --- a/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs +++ b/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs @@ -114,6 +114,9 @@ namespace RGB.NET.Devices.SteelSeries.API _client.Dispose(); } +#pragma warning disable IDE0051 // Remove unused private members + // ReSharper disable UnusedMethodReturnValue.Local + // ReSharper disable UnusedMember.Local private static string TriggerEvent(Event e) => PostJson("/game_event", e); private static string RegisterGoLispHandler(GoLispHandler handler) => PostJson("/load_golisp_handlers", handler); private static string RegisterEvent(Event e) => PostJson("/register_game_event", e); @@ -122,6 +125,9 @@ namespace RGB.NET.Devices.SteelSeries.API private static string UnregisterGame(Game game) => PostJson("/remove_game", game); private static string StopGame(Game game) => PostJson("/stop_game", game); private static string SendHeartbeat(Game game) => PostJson("/game_heartbeat", game); + // ReSharper restore UnusedMember.Local + // ReSharper restore UnusedMethodReturnValue.Local +#pragma warning restore IDE0051 // Remove unused private members private static string PostJson(string urlSuffix, object o) { diff --git a/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs b/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs index 4c3baa1..29a4035 100644 --- a/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs +++ b/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs @@ -1,4 +1,6 @@ -namespace RGB.NET.Devices.SteelSeries +// ReSharper disable InconsistentNaming + +namespace RGB.NET.Devices.SteelSeries { public enum SteelSeriesLedId { diff --git a/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs b/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs index 86f79cf..473ff2e 100644 --- a/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs +++ b/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs @@ -1,4 +1,6 @@ -namespace RGB.NET.Devices.Wooting.Enum +// ReSharper disable InconsistentNaming + +namespace RGB.NET.Devices.Wooting.Enum { public enum WootingDeviceType { diff --git a/RGB.NET.Devices.Wooting/Native/_WootingDeviceInfo.cs b/RGB.NET.Devices.Wooting/Native/_WootingDeviceInfo.cs index d22a518..b1a7d51 100644 --- a/RGB.NET.Devices.Wooting/Native/_WootingDeviceInfo.cs +++ b/RGB.NET.Devices.Wooting/Native/_WootingDeviceInfo.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +#pragma warning disable IDE1006 // Naming Styles +// ReSharper disable InconsistentNaming + +using System.Runtime.InteropServices; using RGB.NET.Devices.Wooting.Enum; namespace RGB.NET.Devices.Wooting.Native diff --git a/RGB.NET.Layout/DeviceLayout.cs b/RGB.NET.Layout/DeviceLayout.cs index dbcaa88..77049e9 100644 --- a/RGB.NET.Layout/DeviceLayout.cs +++ b/RGB.NET.Layout/DeviceLayout.cs @@ -149,8 +149,6 @@ namespace RGB.NET.Layout XmlNode? node = (customData as XmlNode) ?? (customData as IEnumerable)?.FirstOrDefault()?.ParentNode; //HACK DarthAffe 16.01.2021: This gives us the CustomData-Node if ((node == null) || (type == null)) return null; - if (type == null) return null; - using MemoryStream ms = new(); using StreamWriter writer = new(ms); diff --git a/RGB.NET.Presets/Textures/Gradients/IGradient.cs b/RGB.NET.Presets/Textures/Gradients/IGradient.cs index 1917256..21c5d07 100644 --- a/RGB.NET.Presets/Textures/Gradients/IGradient.cs +++ b/RGB.NET.Presets/Textures/Gradients/IGradient.cs @@ -1,4 +1,6 @@ -using System; +// ReSharper disable EventNeverSubscribedTo.Global + +using System; using RGB.NET.Core; using RGB.NET.Presets.Decorators; diff --git a/RGB.NET.sln.DotSettings b/RGB.NET.sln.DotSettings index de2906a..f0e61dd 100644 --- a/RGB.NET.sln.DotSettings +++ b/RGB.NET.sln.DotSettings @@ -258,13 +258,16 @@ False False False + 131DMX AFBG API ARGB + BGR BWZ CID CM CMSDK + CUE CUESDK DB DG @@ -273,6 +276,7 @@ EK FM GEZ + GSDK HID HS HSV @@ -284,6 +288,7 @@ PDF PLZ RGB + ROG SAP SDK SQL From 59e11e5b822cc0a8a95eec2bf15dd0618f8dd339 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 31 Jul 2021 16:59:51 +0200 Subject: [PATCH 3/6] Fixed code issues --- .../Color/Behaviors/DefaultColorBehavior.cs | 26 +++--- .../Color/Behaviors/IColorBehavior.cs | 23 ++++++ RGB.NET.Core/Color/HSVColor.cs | 34 +++++--- RGB.NET.Core/Color/HclColor.cs | 38 +++++---- RGB.NET.Core/Color/LabColor.cs | 34 +++++--- RGB.NET.Core/Color/RGBColor.cs | 80 ++++++++++++------- RGB.NET.Core/Color/XYZColor.cs | 38 +++++---- .../ColorCorrection/IColorCorrection.cs | 2 +- .../AbstractUpdateAwareDecorator.cs | 4 + RGB.NET.Core/Decorators/IDecorator.cs | 4 +- RGB.NET.Core/Devices/AbstractRGBDevice.cs | 46 +++++++++-- .../Devices/AbstractRGBDeviceProvider.cs | 75 ++++++++++++++++- RGB.NET.Core/Devices/IRGBDevice.cs | 27 ++++++- RGB.NET.Core/Devices/IRGBDeviceInfo.cs | 3 + RGB.NET.Core/Devices/IRGBDeviceProvider.cs | 18 ++++- RGB.NET.Core/Devices/KeyboardLayoutType.cs | 5 ++ .../Devices/TypeInterfaces/IKeyboard.cs | 11 ++- RGB.NET.Core/Events/ExceptionEventArgs.cs | 8 ++ RGB.NET.Core/Events/ResolvePathEventArgs.cs | 62 -------------- .../Events/SurfaceLayoutChangedEventArgs.cs | 3 +- .../Exceptions/DeviceProviderException.cs | 14 +++- RGB.NET.Core/Extensions/ColorExtensions.cs | 7 +- RGB.NET.Core/Extensions/MathExtensions.cs | 16 +++- RGB.NET.Core/Extensions/PointExtensions.cs | 7 +- .../Extensions/RectangleExtensions.cs | 38 +++++---- RGB.NET.Core/Extensions/SurfaceExtensions.cs | 22 ++++- RGB.NET.Core/Groups/AbstractLedGroup.cs | 6 ++ RGB.NET.Core/Groups/ILedGroup.cs | 6 ++ RGB.NET.Core/Groups/LedGroupExtension.cs | 9 ++- RGB.NET.Core/Groups/ListLedGroup.cs | 18 ++--- RGB.NET.Core/Helper/DeviceHelper.cs | 12 +++ RGB.NET.Core/Ids/IdGenerator.cs | 12 +++ RGB.NET.Core/Leds/Led.cs | 4 + RGB.NET.Core/Leds/LedMapping.cs | 68 ++++++++++++++++ RGB.NET.Core/Positioning/IPlaceable.cs | 30 +++++++ RGB.NET.Core/Positioning/Placeable.cs | 63 +++++++++++++++ RGB.NET.Core/Positioning/Rectangle.cs | 18 +++-- RGB.NET.Core/Positioning/Rotation.cs | 8 +- RGB.NET.Core/Positioning/Size.cs | 6 +- RGB.NET.Core/RGBSurface.cs | 17 +++- .../Rendering/Brushes/AbstractBrush.cs | 8 +- .../Rendering/Brushes/SolidColorBrush.cs | 3 +- .../Rendering/Brushes/TextureBrush.cs | 12 +++ RGB.NET.Core/Rendering/Textures/ITexture.cs | 22 ++++- .../Rendering/Textures/PixelTexture.cs | 76 +++++++++++++++++- .../Textures/Sampler/AverageColorSampler.cs | 9 ++- .../Rendering/Textures/Sampler/ISampler.cs | 11 ++- .../Rendering/Textures/Sampler/SamplerInfo.cs | 21 +++++ RGB.NET.Core/Update/CustomUpdateData.cs | 2 +- .../Update/Devices/DeviceUpdateTrigger.cs | 22 +++++ RGB.NET.Core/Update/Devices/IUpdateQueue.cs | 8 ++ RGB.NET.Core/Update/IUpdateTrigger.cs | 6 ++ RGB.NET.Core/Update/ManualUpdateTrigger.cs | 6 +- RGB.NET.Core/Update/TimerUpdateTrigger.cs | 13 ++- RGB.NET.Devices.Asus/AsusDeviceProvider.cs | 4 + RGB.NET.Devices.Asus/Enum/AsusLedId.cs | 1 + .../Keyboard/AsusKeyboardLedMapping.cs | 7 +- .../Keyboard/AsusKeyboardRGBDevice.cs | 13 ++- .../Generic/CoolerMasterRGBDeviceInfo.cs | 1 + .../Mouse/CoolerMasterMouseRGBDevice.cs | 3 +- .../Native/_CoolerMasterSDK.cs | 2 +- .../Custom/CorsairCustomRGBDevice.cs | 1 + .../Custom/CorsairCustomRGBDeviceInfo.cs | 43 ++++------ .../Enum/CorsairAccessMode.cs | 2 +- .../Enum/CorsairChannelDeviceType.cs | 2 +- .../Enum/CorsairDeviceCaps.cs | 2 +- .../Enum/CorsairDeviceType.cs | 2 +- RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs | 4 +- .../Enum/CorsairLogicalKeyboardLayout.cs | 3 +- .../Enum/CorsairPhysicalKeyboardLayout.cs | 2 +- .../Enum/CorsairPhysicalMouseLayout.cs | 2 +- .../Generic/LedMappings.cs | 31 +++++++ .../CorsairGraphicsCardRGBDevice.cs | 1 + .../Headset/CorsairHeadsetRGBDevice.cs | 1 + .../CorsairHeadsetStandRGBDevice.cs | 1 + .../Keyboard/CorsairKeyboardRGBDevice.cs | 1 + .../Mainboard/CorsairMainboardRGBDevice.cs | 1 + .../Memory/CorsairMemoryRGBDevice.cs | 1 + .../Mouse/CorsairMouseRGBDevice.cs | 1 + .../Mousepad/CorsairMousepadRGBDevice.cs | 1 + RGB.NET.Devices.Corsair/Native/_CUESDK.cs | 2 +- RGB.NET.Devices.DMX/DMXDeviceProvider.cs | 2 +- .../Enum/LogitechDeviceType.cs | 3 + .../Enum/LogitechLedId.cs | 1 + .../Generic/LedMappings.cs | 24 ++++++ .../Native/_LogitechGSDK.cs | 2 +- RGB.NET.Devices.Msi/Native/_MsiSDK.cs | 2 +- .../Generic/MidiUpdateQueue.cs | 2 +- .../Generic/NovationRGBDevice.cs | 1 + RGB.NET.Devices.PicoPi/PicoPi/LedMappings.cs | 6 ++ RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs | 9 +++ RGB.NET.Devices.Razer/Generic/LedMappings.cs | 24 ++++++ .../Generic/RazerRGBDevice.cs | 1 + RGB.NET.Devices.Razer/Native/_RazerSDK.cs | 2 +- .../Enum/SteelSeriesLedId.cs | 4 + .../Generic/LedMappings.cs | 30 +++++++ .../WS281XDeviceProvider.cs | 5 +- .../Enum/WootingDeviceType.cs | 3 + RGB.NET.HID/HIDLoader.cs | 41 ++++++++++ RGB.NET.Layout/DeviceLayout.cs | 19 ++++- RGB.NET.Layout/IDeviceLayout.cs | 6 ++ RGB.NET.Layout/ILedLayout.cs | 6 ++ RGB.NET.Layout/LayoutExtension.cs | 10 +++ RGB.NET.Layout/LedLayout.cs | 19 +++++ RGB.NET.Presets/Decorators/FlashDecorator.cs | 5 ++ .../Decorators/MoveGradientDecorator.cs | 1 + RGB.NET.Presets/Groups/RectangleLedGroup.cs | 6 +- RGB.NET.Presets/Helper/GradientHelper.cs | 2 +- .../Textures/AbstractGradientTexture.cs | 17 +++- RGB.NET.Presets/Textures/BytePixelTexture.cs | 37 +++++++-- .../Textures/ConicalGradientTexture.cs | 12 ++- RGB.NET.Presets/Textures/Enums/ColorFormat.cs | 7 +- RGB.NET.Presets/Textures/FloatPixelTexture.cs | 37 +++++++-- .../Textures/Gradients/LinearGradient.cs | 4 +- .../Textures/Gradients/RainbowGradient.cs | 2 +- .../Textures/LinearGradientTexture.cs | 7 +- .../Textures/RadialGradientTexture.cs | 7 +- .../Textures/Sampler/AverageByteSampler.cs | 6 +- .../Textures/Sampler/AverageFloatSampler.cs | 6 +- Tests/RGB.NET.Core.Tests/Color/ColorTest.cs | 36 ++++++--- 120 files changed, 1348 insertions(+), 342 deletions(-) delete mode 100644 RGB.NET.Core/Events/ResolvePathEventArgs.cs diff --git a/RGB.NET.Core/Color/Behaviors/DefaultColorBehavior.cs b/RGB.NET.Core/Color/Behaviors/DefaultColorBehavior.cs index 48ef24f..6e7e4c1 100644 --- a/RGB.NET.Core/Color/Behaviors/DefaultColorBehavior.cs +++ b/RGB.NET.Core/Color/Behaviors/DefaultColorBehavior.cs @@ -1,5 +1,11 @@ -namespace RGB.NET.Core +using System; + +namespace RGB.NET.Core { + /// + /// + /// Represents the default-behavior for the work with colors. + /// public class DefaultColorBehavior : IColorBehavior { #region Methods @@ -13,11 +19,12 @@ /// /// Tests whether the specified object is a and is equivalent to this . /// + /// The color to test. /// The object to test. /// true if is a equivalent to this ; otherwise, false. public virtual bool Equals(in Color color, object? obj) { - if (!(obj is Color color2)) return false; + if (obj is not Color color2) return false; (float a, float r, float g, float b) = color2.GetRGB(); return color.A.EqualsInTolerance(a) && color.R.EqualsInTolerance(r) && color.G.EqualsInTolerance(g) && color.B.EqualsInTolerance(b); @@ -27,22 +34,13 @@ /// Returns a hash code for this . /// /// An integer value that specifies the hash code for this . - public virtual int GetHashCode(in Color color) - { - unchecked - { - int hashCode = color.A.GetHashCode(); - hashCode = (hashCode * 397) ^ color.R.GetHashCode(); - hashCode = (hashCode * 397) ^ color.G.GetHashCode(); - hashCode = (hashCode * 397) ^ color.B.GetHashCode(); - return hashCode; - } - } + public virtual int GetHashCode(in Color color) => HashCode.Combine(color.A, color.R, color.G, color.B); /// /// Blends a over this color. /// - /// The to blend. + /// The to to blend over. + /// The to blend. public virtual Color Blend(in Color baseColor, in Color blendColor) { if (blendColor.A.EqualsInTolerance(0)) return baseColor; diff --git a/RGB.NET.Core/Color/Behaviors/IColorBehavior.cs b/RGB.NET.Core/Color/Behaviors/IColorBehavior.cs index 0e4a23f..cbc117f 100644 --- a/RGB.NET.Core/Color/Behaviors/IColorBehavior.cs +++ b/RGB.NET.Core/Color/Behaviors/IColorBehavior.cs @@ -1,13 +1,36 @@ namespace RGB.NET.Core { + /// + /// Represents a behavior of a color for base operations. + /// public interface IColorBehavior { + /// + /// Converts the specified to a string representation. + /// + /// The color to convert. + /// The string representation of the specified color. string ToString(in Color color); + /// + /// Tests whether the specified object is a and is equivalent to this . + /// + /// The color to test. + /// The object to test. + /// true if is a equivalent to this ; otherwise, false. bool Equals(in Color color, object? obj); + /// + /// Returns a hash code for this . + /// + /// An integer value that specifies the hash code for this . int GetHashCode(in Color color); + /// + /// Blends a over this color. + /// + /// The to to blend over. + /// The to blend. Color Blend(in Color baseColor, in Color blendColor); } } diff --git a/RGB.NET.Core/Color/HSVColor.cs b/RGB.NET.Core/Color/HSVColor.cs index 492742f..5bc4cba 100644 --- a/RGB.NET.Core/Color/HSVColor.cs +++ b/RGB.NET.Core/Color/HSVColor.cs @@ -4,6 +4,9 @@ using System; namespace RGB.NET.Core { + /// + /// Contains helper-methods and extension for the -type to work in the HSV color space. + /// public static class HSVColor { #region Getter @@ -11,22 +14,22 @@ namespace RGB.NET.Core /// /// Gets the hue component value (HSV-color space) of this as degree in the range [0..360]. /// - /// - /// + /// The color to get the value from. + /// The hue component value of the color. public static float GetHue(this in Color color) => color.GetHSV().hue; /// /// Gets the saturation component value (HSV-color space) of this in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// The saturation component value of the color. public static float GetSaturation(this in Color color) => color.GetHSV().saturation; /// /// Gets the value component value (HSV-color space) of this in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// The value component value of the color. public static float GetValue(this in Color color) => color.GetHSV().value; /// @@ -35,8 +38,8 @@ namespace RGB.NET.Core /// Saturation in the range [0..1]. /// Value in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// A tuple containing the hue, saturation and value component value of the color. public static (float hue, float saturation, float value) GetHSV(this in Color color) => CaclulateHSVFromRGB(color.R, color.G, color.B); @@ -45,8 +48,9 @@ namespace RGB.NET.Core #region Manipulation /// - /// Adds the given HSV values to this color. + /// Adds the specified HSV values to this color. /// + /// The color to modify. /// The hue value to add. /// The saturation value to add. /// The value value to add. @@ -58,8 +62,9 @@ namespace RGB.NET.Core } /// - /// Subtracts the given HSV values to this color. + /// Subtracts the specified HSV values to this color. /// + /// The color to modify. /// The hue value to subtract. /// The saturation value to subtract. /// The value value to subtract. @@ -71,8 +76,9 @@ namespace RGB.NET.Core } /// - /// Multiplies the given HSV values to this color. + /// Multiplies the specified HSV values to this color. /// + /// The color to modify. /// The hue value to multiply. /// The saturation value to multiply. /// The value value to multiply. @@ -84,8 +90,9 @@ namespace RGB.NET.Core } /// - /// Divides the given HSV values to this color. + /// Divides the specified HSV values to this color. /// + /// The color to modify. /// The hue value to divide. /// The saturation value to divide. /// The value value to divide. @@ -97,8 +104,9 @@ namespace RGB.NET.Core } /// - /// Sets the given hue value of this color. + /// Sets the specified hue value of this color. /// + /// The color to modify. /// The hue value to set. /// The saturation value to set. /// The value value to set. diff --git a/RGB.NET.Core/Color/HclColor.cs b/RGB.NET.Core/Color/HclColor.cs index 3adc41b..e4554d6 100644 --- a/RGB.NET.Core/Color/HclColor.cs +++ b/RGB.NET.Core/Color/HclColor.cs @@ -4,6 +4,9 @@ using System; namespace RGB.NET.Core { + /// + /// Contains helper-methods and extension for the -type to work in the Hcl color space. + /// public static class HclColor { #region Getter @@ -11,23 +14,23 @@ namespace RGB.NET.Core /// /// Gets the H component value (Hcl-color space) of this in the range [0..360]. /// - /// - /// - public static float GetHclH(this in Color color) => color.GetHcl().l; + /// The color to get the value from. + /// The H component value of the color. + public static float GetHclH(this in Color color) => color.GetHcl().h; /// /// Gets the c component value (Hcl-color space) of this in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// The c component value of the color. public static float GetHclC(this in Color color) => color.GetHcl().c; /// /// Gets the l component value (Hcl-color space) of this in the range [0..1]. /// - /// - /// - public static float GetHclL(this in Color color) => color.GetHcl().h; + /// The color to get the value from. + /// The l component value of the color. + public static float GetHclL(this in Color color) => color.GetHcl().l; /// /// Gets the H, c and l component values (Hcl-color space) of this . @@ -35,8 +38,8 @@ namespace RGB.NET.Core /// c in the range [0..1]. /// l in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// A tuple containing the H, c and l component value of the color. public static (float h, float c, float l) GetHcl(this in Color color) => CalculateHclFromRGB(color.R, color.G, color.B); @@ -45,8 +48,9 @@ namespace RGB.NET.Core #region Manipulation /// - /// Adds the given Hcl values to this color. + /// Adds the specified Hcl values to this color. /// + /// The color to modify. /// The H value to add. /// The c value to add. /// The l value to add. @@ -58,8 +62,9 @@ namespace RGB.NET.Core } /// - /// Subtracts the given Hcl values to this color. + /// Subtracts the specified Hcl values to this color. /// + /// The color to modify. /// The H value to subtract. /// The c value to subtract. /// The l value to subtract. @@ -71,8 +76,9 @@ namespace RGB.NET.Core } /// - /// Multiplies the given Hcl values to this color. + /// Multiplies the specified Hcl values to this color. /// + /// The color to modify. /// The H value to multiply. /// The c value to multiply. /// The l value to multiply. @@ -84,8 +90,9 @@ namespace RGB.NET.Core } /// - /// Divides the given Hcl values to this color. + /// Divides the specified Hcl values to this color. /// + /// The color to modify. /// The H value to divide. /// The c value to divide. /// The l value to divide. @@ -97,8 +104,9 @@ namespace RGB.NET.Core } /// - /// Sets the given X value of this color. + /// Sets the specified X value of this color. /// + /// The color to modify. /// The H value to set. /// The c value to set. /// The l value to set. diff --git a/RGB.NET.Core/Color/LabColor.cs b/RGB.NET.Core/Color/LabColor.cs index 3da5f2c..af212cb 100644 --- a/RGB.NET.Core/Color/LabColor.cs +++ b/RGB.NET.Core/Color/LabColor.cs @@ -4,6 +4,9 @@ using System; namespace RGB.NET.Core { + /// + /// Contains helper-methods and extension for the -type to work in the Lab color space. + /// public static class LabColor { #region Getter @@ -11,22 +14,22 @@ namespace RGB.NET.Core /// /// Gets the L component value (Lab-color space) of this in the range [0..100]. /// - /// - /// + /// The color to get the value from. + /// The L component value of the color. public static float GetLabL(this in Color color) => color.GetLab().l; /// /// Gets the a component value (Lab-color space) of this in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// The a component value of the color. public static float GetLabA(this in Color color) => color.GetLab().a; /// /// Gets the b component value (Lab-color space) of this in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// The b component value of the color. public static float GetLabB(this in Color color) => color.GetLab().b; /// @@ -35,8 +38,8 @@ namespace RGB.NET.Core /// a in the range [0..1]. /// b in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// A tuple containing the L, a and b component value of the color. public static (float l, float a, float b) GetLab(this in Color color) => CalculateLabFromRGB(color.R, color.G, color.B); @@ -45,8 +48,9 @@ namespace RGB.NET.Core #region Manipulation /// - /// Adds the given Lab values to this color. + /// Adds the specified Lab values to this color. /// + /// The color to modify. /// The L value to add. /// The a value to add. /// The b value to add. @@ -58,8 +62,9 @@ namespace RGB.NET.Core } /// - /// Subtracts the given Lab values to this color. + /// Subtracts the specified Lab values to this color. /// + /// The color to modify. /// The L value to subtract. /// The a value to subtract. /// The b value to subtract. @@ -71,8 +76,9 @@ namespace RGB.NET.Core } /// - /// Multiplies the given Lab values to this color. + /// Multiplies the specified Lab values to this color. /// + /// The color to modify. /// The L value to multiply. /// The a value to multiply. /// The b value to multiply. @@ -84,8 +90,9 @@ namespace RGB.NET.Core } /// - /// Divides the given Lab values to this color. + /// Divides the specified Lab values to this color. /// + /// The color to modify. /// The L value to divide. /// The a value to divide. /// The b value to divide. @@ -97,8 +104,9 @@ namespace RGB.NET.Core } /// - /// Sets the given X valueof this color. + /// Sets the specified X valueof this color. /// + /// The color to modify. /// The L value to set. /// The a value to set. /// The b value to set. diff --git a/RGB.NET.Core/Color/RGBColor.cs b/RGB.NET.Core/Color/RGBColor.cs index 9f4c2cb..2f78733 100644 --- a/RGB.NET.Core/Color/RGBColor.cs +++ b/RGB.NET.Core/Color/RGBColor.cs @@ -4,6 +4,9 @@ using System; namespace RGB.NET.Core { + /// + /// Contains helper-methods and extension for the -type to work in the RGB color space. + /// public static class RGBColor { #region Getter @@ -11,44 +14,44 @@ namespace RGB.NET.Core /// /// Gets the A component value of this as byte in the range [0..255]. /// - /// - /// + /// The color to get the value from. + /// The A component value of the color. public static byte GetA(this in Color color) => color.A.GetByteValueFromPercentage(); /// /// Gets the R component value of this as byte in the range [0..255]. /// - /// - /// + /// The color to get the value from. + /// The R component value of the color. public static byte GetR(this in Color color) => color.R.GetByteValueFromPercentage(); /// /// Gets the G component value of this as byte in the range [0..255]. /// - /// - /// + /// The color to get the value from. + /// The G component value of the color. public static byte GetG(this in Color color) => color.G.GetByteValueFromPercentage(); /// /// Gets the B component value of this as byte in the range [0..255]. /// - /// - /// + /// The color to get the value from. + /// The B component value of the color. public static byte GetB(this in Color color) => color.B.GetByteValueFromPercentage(); /// /// Gets the A, R, G and B component value of this as byte in the range [0..255]. /// - /// - /// + /// The color to get the value from. + /// A tuple containing the A, R, G and B component value of the color. public static (byte a, byte r, byte g, byte b) GetRGBBytes(this in Color color) => (color.GetA(), color.GetR(), color.GetG(), color.GetB()); /// /// Gets the A, R, G and B component value of this as percentage in the range [0..1]. /// - /// - /// + /// The color to get the value from. + /// A tuple containing the A, R, G and B component value of the color. public static (float a, float r, float g, float b) GetRGB(this in Color color) => (color.A, color.R, color.G, color.B); @@ -59,8 +62,9 @@ namespace RGB.NET.Core #region Add /// - /// Adds the given RGB values to this color. + /// Adds the specified RGB values to this color. /// + /// The color to modify. /// The red value to add. /// The green value to add. /// The blue value to add. @@ -69,8 +73,9 @@ namespace RGB.NET.Core => new(color.A, color.GetR() + r, color.GetG() + g, color.GetB() + b); /// - /// Adds the given RGB-percent values to this color. + /// Adds the specified RGB-percent values to this color. /// + /// The color to modify. /// The red value to add. /// The green value to add. /// The blue value to add. @@ -79,16 +84,18 @@ namespace RGB.NET.Core => new(color.A, color.R + r, color.G + g, color.B + b); /// - /// Adds the given alpha value to this color. + /// Adds the specified alpha value to this color. /// + /// The color to modify. /// The alpha value to add. /// The new color after the modification. public static Color AddA(this in Color color, int a) => new(color.GetA() + a, color.R, color.G, color.B); /// - /// Adds the given alpha-percent value to this color. + /// Adds the specified alpha-percent value to this color. /// + /// The color to modify. /// The alpha value to add. /// The new color after the modification. public static Color AddA(this in Color color, float a) @@ -99,8 +106,9 @@ namespace RGB.NET.Core #region Subtract /// - /// Subtracts the given RGB values to this color. + /// Subtracts the specified RGB values to this color. /// + /// The color to modify. /// The red value to subtract. /// The green value to subtract. /// The blue value to subtract. @@ -109,8 +117,9 @@ namespace RGB.NET.Core => new(color.A, color.GetR() - r, color.GetG() - g, color.GetB() - b); /// - /// Subtracts the given RGB values to this color. + /// Subtracts the specified RGB values to this color. /// + /// The color to modify. /// The red value to subtract. /// The green value to subtract. /// The blue value to subtract. @@ -119,17 +128,19 @@ namespace RGB.NET.Core => new(color.A, color.R - r, color.G - g, color.B - b); /// - /// Subtracts the given alpha value to this color. + /// Subtracts the specified alpha value to this color. /// + /// The color to modify. /// The alpha value to subtract. /// The new color after the modification. public static Color SubtractA(this in Color color, int a) => new(color.GetA() - a, color.R, color.G, color.B); /// - /// Subtracts the given alpha-percent value to this color. + /// Subtracts the specified alpha-percent value to this color. /// - /// The alpha value to subtract. + /// The color to modify. + /// The alpha value to subtract. /// The new color after the modification. public static Color SubtractA(this in Color color, float aPercent) => new(color.A - aPercent, color.R, color.G, color.B); @@ -139,8 +150,9 @@ namespace RGB.NET.Core #region Multiply /// - /// Multiplies the given RGB values to this color. + /// Multiplies the specified RGB values to this color. /// + /// The color to modify. /// The red value to multiply. /// The green value to multiply. /// The blue value to multiply. @@ -149,8 +161,9 @@ namespace RGB.NET.Core => new(color.A, color.R * r, color.G * g, color.B * b); /// - /// Multiplies the given alpha value to this color. + /// Multiplies the specified alpha value to this color. /// + /// The color to modify. /// The alpha value to multiply. /// The new color after the modification. public static Color MultiplyA(this in Color color, float a) @@ -161,8 +174,9 @@ namespace RGB.NET.Core #region Divide /// - /// Divides the given RGB values to this color. + /// Divides the specified RGB values to this color. /// + /// The color to modify. /// The red value to divide. /// The green value to divide. /// The blue value to divide. @@ -171,8 +185,9 @@ namespace RGB.NET.Core => new(color.A, color.R / r, color.G / g, color.B / b); /// - /// Divides the given alpha value to this color. + /// Divides the specified alpha value to this color. /// + /// The color to modify. /// The alpha value to divide. /// The new color after the modification. public static Color DivideA(this in Color color, float a) @@ -183,8 +198,9 @@ namespace RGB.NET.Core #region Set /// - /// Sets the given RGB value of this color. + /// Sets the specified RGB value of this color. /// + /// The color to modify. /// The red value to set. /// The green value to set. /// The blue value to set. @@ -193,8 +209,9 @@ namespace RGB.NET.Core => new(color.A, r ?? color.GetR(), g ?? color.GetG(), b ?? color.GetB()); /// - /// Sets the given RGB value of this color. + /// Sets the specified RGB value of this color. /// + /// The color to modify. /// The red value to set. /// The green value to set. /// The blue value to set. @@ -203,8 +220,9 @@ namespace RGB.NET.Core => new(color.A, r ?? color.GetR(), g ?? color.GetG(), b ?? color.GetB()); /// - /// Sets the given RGB value of this color. + /// Sets the specified RGB value of this color. /// + /// The color to modify. /// The red value to set. /// The green value to set. /// The blue value to set. @@ -213,15 +231,17 @@ namespace RGB.NET.Core => new(color.A, r ?? color.R, g ?? color.G, b ?? color.B); /// - /// Sets the given alpha value of this color. + /// Sets the specified alpha value of this color. /// + /// The color to modify. /// The alpha value to set. /// The new color after the modification. public static Color SetA(this in Color color, int a) => new(a, color.R, color.G, color.B); /// - /// Sets the given alpha value of this color. + /// Sets the specified alpha value of this color. /// + /// The color to modify. /// The alpha value to set. /// The new color after the modification. public static Color SetA(this in Color color, float a) => new(a, color.R, color.G, color.B); diff --git a/RGB.NET.Core/Color/XYZColor.cs b/RGB.NET.Core/Color/XYZColor.cs index d02329e..97363a8 100644 --- a/RGB.NET.Core/Color/XYZColor.cs +++ b/RGB.NET.Core/Color/XYZColor.cs @@ -4,6 +4,9 @@ using System; namespace RGB.NET.Core { + /// + /// Contains helper-methods and extension for the -type to work in the XYZ color space. + /// public static class XYZColor { #region Getter @@ -11,22 +14,22 @@ namespace RGB.NET.Core /// /// Gets the X component value (XYZ-color space) of this in the range [0..95.047]. /// - /// - /// + /// The color to get the value from. + /// The X component value of the color. public static float GetX(this in Color color) => color.GetXYZ().x; /// /// Gets the Y component value (XYZ-color space) of this in the range [0..100]. /// - /// - /// + /// The color to get the value from. + /// The Y component value of the color. public static float GetY(this in Color color) => color.GetXYZ().y; /// /// Gets the Z component value (XYZ-color space) of this in the range [0..108.883]. /// - /// - /// + /// The color to get the value from. + /// The Z component value of the color. public static float GetZ(this in Color color) => color.GetXYZ().z; /// @@ -35,8 +38,8 @@ namespace RGB.NET.Core /// Y in the range [0..100]. /// Z in the range [0..108.883]. /// - /// - /// + /// The color to get the value from. + /// A tuple containing the X, Y and Z component value of the color. public static (float x, float y, float z) GetXYZ(this in Color color) => CaclulateXYZFromRGB(color.R, color.G, color.B); @@ -45,8 +48,9 @@ namespace RGB.NET.Core #region Manipulation /// - /// Adds the given XYZ values to this color. + /// Adds the specified XYZ values to this color. /// + /// The color to modify. /// The X value to add. /// The Y value to add. /// The Z value to add. @@ -58,8 +62,9 @@ namespace RGB.NET.Core } /// - /// Subtracts the given XYZ values to this color. + /// Subtracts the specified XYZ values to this color. /// + /// The color to modify. /// The X value to subtract. /// The Y value to subtract. /// The Z value to subtract. @@ -71,8 +76,9 @@ namespace RGB.NET.Core } /// - /// Multiplies the given XYZ values to this color. + /// Multiplies the specified XYZ values to this color. /// + /// The color to modify. /// The X value to multiply. /// The Y value to multiply. /// The Z value to multiply. @@ -84,8 +90,9 @@ namespace RGB.NET.Core } /// - /// Divides the given XYZ values to this color. + /// Divides the specified XYZ values to this color. /// + /// The color to modify. /// The X value to divide. /// The Y value to divide. /// The Z value to divide. @@ -97,16 +104,17 @@ namespace RGB.NET.Core } /// - /// Sets the given X valueof this color. + /// Sets the specified X valueof this color. /// + /// The color to modify. /// The X value to set. /// The Y value to set. /// The Z value to set. /// The new color after the modification. - public static Color SetXYZ(this in Color color, float? x = null, float? y = null, float? value = null) + public static Color SetXYZ(this in Color color, float? x = null, float? y = null, float? z = null) { (float cX, float cY, float cZ) = color.GetXYZ(); - return Create(color.A, x ?? cX, y ?? cY, value ?? cZ); + return Create(color.A, x ?? cX, y ?? cY, z ?? cZ); } #endregion diff --git a/RGB.NET.Core/ColorCorrection/IColorCorrection.cs b/RGB.NET.Core/ColorCorrection/IColorCorrection.cs index f738f5a..c61cc7f 100644 --- a/RGB.NET.Core/ColorCorrection/IColorCorrection.cs +++ b/RGB.NET.Core/ColorCorrection/IColorCorrection.cs @@ -8,7 +8,7 @@ namespace RGB.NET.Core public interface IColorCorrection { /// - /// Applies the to the given . + /// Applies the to the specified . /// /// The to correct. void ApplyTo(ref Color color); diff --git a/RGB.NET.Core/Decorators/AbstractUpdateAwareDecorator.cs b/RGB.NET.Core/Decorators/AbstractUpdateAwareDecorator.cs index 7217d25..6552510 100644 --- a/RGB.NET.Core/Decorators/AbstractUpdateAwareDecorator.cs +++ b/RGB.NET.Core/Decorators/AbstractUpdateAwareDecorator.cs @@ -8,6 +8,9 @@ { #region Properties & Fields + /// + /// Gets the surface this decorator is attached to. + /// protected RGBSurface Surface { get; } /// @@ -22,6 +25,7 @@ /// /// Initializes a new instance of the class. /// + /// The surface this decorator is attached to. /// Bool indicating if the should call even if the Decorator is disabled. protected AbstractUpdateAwareDecorator(RGBSurface surface, bool updateIfDisabled = false) { diff --git a/RGB.NET.Core/Decorators/IDecorator.cs b/RGB.NET.Core/Decorators/IDecorator.cs index 1e9acdd..e955d3f 100644 --- a/RGB.NET.Core/Decorators/IDecorator.cs +++ b/RGB.NET.Core/Decorators/IDecorator.cs @@ -23,13 +23,13 @@ #region Methods /// - /// Attaches this to the given target. + /// Attaches this to the specified target. /// /// The object this should be attached to. void OnAttached(IDecoratable decoratable); /// - /// Detaches this from the given target. + /// Detaches this from the specified target. /// /// The object this should be detached from. void OnDetached(IDecoratable decoratable); diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs index 4505c42..f851f41 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs @@ -52,6 +52,9 @@ namespace RGB.NET.Core /// protected Dictionary LedMapping { get; } = new(); + /// + /// Gets the update queue used to update this device. + /// protected IUpdateQueue UpdateQueue { get; } #region Indexer @@ -72,6 +75,11 @@ namespace RGB.NET.Core #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The device info of this device. + /// The queue used to update this device. protected AbstractRGBDevice(TDeviceInfo deviceInfo, IUpdateQueue updateQueue) { this.DeviceInfo = deviceInfo; @@ -97,7 +105,22 @@ namespace RGB.NET.Core UpdateLeds(ledsToUpdate); } + /// + /// Gets an enumerable of LEDs that are changed and requires an update. + /// + /// Forces all LEDs to be treated as dirty. + /// The collection LEDs to update. protected virtual IEnumerable GetLedsToUpdate(bool flushLeds) => ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)).Where(led => led.RequestedColor?.A > 0); + + /// + /// Gets an enumerable of a custom data and color tuple for the specified leds. + /// + /// + /// Applies all . + /// if no ist specified the is used. + /// + /// The enumerable of leds to convert. + /// The enumerable of custom data and color tuples for the specified leds. protected virtual IEnumerable<(object key, Color color)> GetUpdateData(IEnumerable leds) { if (ColorCorrections.Count > 0) @@ -145,13 +168,7 @@ namespace RGB.NET.Core protected virtual void DeviceUpdate() { } - /// - /// Initializes the with the specified id. - /// - /// The to initialize. - /// The location of the to initialize. - /// The size of the to initialize. - /// The initialized led. + /// public virtual Led? AddLed(LedId ledId, in Point location, in Size size, object? customData = null) { if ((ledId == LedId.Invalid) || LedMapping.ContainsKey(ledId)) return null; @@ -161,6 +178,7 @@ namespace RGB.NET.Core return led; } + /// public virtual Led? RemoveLed(LedId ledId) { if (ledId == LedId.Invalid) return null; @@ -170,8 +188,19 @@ namespace RGB.NET.Core return led; } + /// + /// + /// + /// + /// protected virtual object? GetLedCustomData(LedId ledId) => null; + /// + /// Called when the device is attached to a surface. + /// + /// + /// When overriden base should be called to validate boundries. + /// protected virtual void OnAttached() { if (Location == Point.Invalid) Location = new Point(0, 0); @@ -182,6 +211,9 @@ namespace RGB.NET.Core } } + /// + /// Called when the device is detached from a surface. + /// protected virtual void OnDetached() { } #region Enumerator diff --git a/RGB.NET.Core/Devices/AbstractRGBDeviceProvider.cs b/RGB.NET.Core/Devices/AbstractRGBDeviceProvider.cs index e81f72c..81ac6f2 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDeviceProvider.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDeviceProvider.cs @@ -5,31 +5,48 @@ using System.Linq; namespace RGB.NET.Core { + /// + /// Represents the abstract base implementation for a . + /// public abstract class AbstractRGBDeviceProvider : IRGBDeviceProvider { #region Properties & Fields private readonly double _defaultUpdateRateHardLimit; + /// public bool IsInitialized { get; protected set; } + + /// public bool ThrowsExceptions { get; protected set; } + /// public virtual IEnumerable Devices { get; protected set; } = Enumerable.Empty(); + /// + /// Gets the dictionary containing the registered update triggers. + /// Normally should be used to access them. + /// protected Dictionary UpdateTriggerMapping { get; } = new(); + /// public ReadOnlyCollection<(int id, IDeviceUpdateTrigger trigger)> UpdateTriggers => new(UpdateTriggerMapping.Select(x => (x.Key, x.Value)).ToList()); #endregion #region Events + /// public event EventHandler? Exception; #endregion #region Constructors - + + /// + /// Initializes a new instance of the class. + /// + /// The update rate hard limit all update triggers for this device provider are initialized with. protected AbstractRGBDeviceProvider(double defaultUpdateRateHardLimit = 0) { this._defaultUpdateRateHardLimit = defaultUpdateRateHardLimit; @@ -39,6 +56,7 @@ namespace RGB.NET.Core #region Methods + /// public bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool throwExceptions = false) { ThrowsExceptions = throwExceptions; @@ -71,6 +89,14 @@ namespace RGB.NET.Core return true; } + /// + /// Loads devices and returns a filtered list of them. + /// + /// + /// The underlying loading of the devices happens in . + /// + /// -flags to filter the device with. + /// The filtered collection of loaded devices. protected virtual IEnumerable GetLoadedDevices(RGBDeviceType loadFilter) { List devices = new(); @@ -92,10 +118,29 @@ namespace RGB.NET.Core return devices; } + /// + /// Initializes the underlying SDK. + /// protected abstract void InitializeSDK(); + /// + /// Loads all devices this device provider is capable of loading. + /// + /// + /// Filtering happens in . + /// + /// A collection of loaded devices. protected abstract IEnumerable LoadDevices(); + /// + /// Gets the mapped to the specified id or a new one if the id wasn't requested before. + /// + /// + /// The creation of the update trigger happens in . + /// + /// The id of the update trigger. + /// The update rate hard limit to be set in the update trigger. + /// The update trigger mapped to the specified id. protected virtual IDeviceUpdateTrigger GetUpdateTrigger(int id = -1, double? updateRateHardLimit = null) { if (!UpdateTriggerMapping.TryGetValue(id, out IDeviceUpdateTrigger? updaeTrigger)) @@ -104,8 +149,18 @@ namespace RGB.NET.Core return updaeTrigger; } + /// + /// Creates a update trigger with the specified id and the specified update rate hard limit. + /// + /// The id of the update trigger. + /// The update rate hard limit tobe set in the update trigger. + /// The newly created update trigger. protected virtual IDeviceUpdateTrigger CreateUpdateTrigger(int id, double updateRateHardLimit) => new DeviceUpdateTrigger(updateRateHardLimit); + + /// + /// Resets the device provider and disposes all devices and update triggers. + /// protected virtual void Reset() { foreach (IDeviceUpdateTrigger updateTrigger in UpdateTriggerMapping.Values) @@ -115,9 +170,15 @@ namespace RGB.NET.Core device.Dispose(); Devices = Enumerable.Empty(); + UpdateTriggerMapping.Clear(); IsInitialized = false; } + /// + /// Triggers the -event and throws the specified exception if is true and it is not overriden in the event. + /// + /// The exception to throw. + /// Indicates if the exception is critical for device provider to work correctly. protected virtual void Throw(Exception ex, bool isCritical = false) { ExceptionEventArgs args = new(ex, isCritical, ThrowsExceptions); @@ -127,9 +188,19 @@ namespace RGB.NET.Core throw new DeviceProviderException(ex, isCritical); } + /// + /// Throws the event. + /// + /// The parameters passed to the event. protected virtual void OnException(ExceptionEventArgs args) => Exception?.Invoke(this, args); - public virtual void Dispose() => Reset(); + /// + public virtual void Dispose() + { + Reset(); + + GC.SuppressFinalize(this); + } #endregion } diff --git a/RGB.NET.Core/Devices/IRGBDevice.cs b/RGB.NET.Core/Devices/IRGBDevice.cs index 983d54d..28c2dde 100644 --- a/RGB.NET.Core/Devices/IRGBDevice.cs +++ b/RGB.NET.Core/Devices/IRGBDevice.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; namespace RGB.NET.Core { - /// + /// /// /// /// @@ -13,6 +13,9 @@ namespace RGB.NET.Core { #region Properties + /// + /// Gets the surface this device is attached to. + /// RGBSurface? Surface { get; internal set; } /// @@ -20,6 +23,9 @@ namespace RGB.NET.Core /// IRGBDeviceInfo DeviceInfo { get; } + /// + /// Gets a list of color corrections applied to this device. + /// IList ColorCorrections { get; } #endregion @@ -34,14 +40,14 @@ namespace RGB.NET.Core Led? this[LedId ledId] { get; } /// - /// Gets the at the given physical location. + /// Gets the at the specified physical location. /// /// The to get the location from. - /// The at the given or null if no location is found. + /// The at the specified or null if no location is found. Led? this[Point location] { get; } /// - /// Gets a list of inside the given . + /// Gets a list of inside the specified . /// /// The to check. /// The minimal percentage overlay a must have with the to be taken into the list. @@ -58,8 +64,21 @@ namespace RGB.NET.Core /// Specifies whether all (including clean ones) should be updated. void Update(bool flushLeds = false); + /// + /// Adds a led to the device. + /// + /// The id of the led. + /// The location of the led on the device. + /// The size of the led. + /// Custom data saved on the led. + /// The newly added led or null if a led with this id is already added. Led? AddLed(LedId ledId, in Point location, in Size size, object? customData = null); + /// + /// Removes the led with the specified id from the device. + /// + /// The id of the led to remove. + /// The removed led or null if there was no led with the specified id. Led? RemoveLed(LedId ledId); #endregion diff --git a/RGB.NET.Core/Devices/IRGBDeviceInfo.cs b/RGB.NET.Core/Devices/IRGBDeviceInfo.cs index 3bb29c2..10de56e 100644 --- a/RGB.NET.Core/Devices/IRGBDeviceInfo.cs +++ b/RGB.NET.Core/Devices/IRGBDeviceInfo.cs @@ -27,6 +27,9 @@ /// string Model { get; } + /// + /// Gets custom metadata added to the layout. + /// object? LayoutMetadata { get; set; } #endregion diff --git a/RGB.NET.Core/Devices/IRGBDeviceProvider.cs b/RGB.NET.Core/Devices/IRGBDeviceProvider.cs index cad53ce..d2a8d1d 100644 --- a/RGB.NET.Core/Devices/IRGBDeviceProvider.cs +++ b/RGB.NET.Core/Devices/IRGBDeviceProvider.cs @@ -19,10 +19,18 @@ namespace RGB.NET.Core bool IsInitialized { get; } /// - /// Gets a list of loaded by this . + /// Indicates if exceptions in the device provider are thrown or silently ignored. + /// + bool ThrowsExceptions { get; } + + /// + /// Gets a collection of loaded by this . /// IEnumerable Devices { get; } + /// + /// Gets a collection registered to this device provider. + /// ReadOnlyCollection<(int id, IDeviceUpdateTrigger trigger)> UpdateTriggers { get; } #endregion @@ -30,7 +38,7 @@ namespace RGB.NET.Core #region Events /// - /// Occurs when an exception is thrown in the device provider + /// Occurs when an exception is thrown in the device provider. /// event EventHandler? Exception; @@ -38,6 +46,12 @@ namespace RGB.NET.Core #region Methods + /// + /// Initializes the device provider and loads available devices. + /// + /// -flags to filter the devices to load. + /// Specifies if exceptions should be thrown or silently be ignored. + /// true if the initialization was successful; false otherwise. bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool throwExceptions = false); #endregion diff --git a/RGB.NET.Core/Devices/KeyboardLayoutType.cs b/RGB.NET.Core/Devices/KeyboardLayoutType.cs index b763057..fec594c 100644 --- a/RGB.NET.Core/Devices/KeyboardLayoutType.cs +++ b/RGB.NET.Core/Devices/KeyboardLayoutType.cs @@ -1,6 +1,11 @@ // ReSharper disable InconsistentNaming +#pragma warning disable 1591 + namespace RGB.NET.Core { + /// + /// Contains a list of available keyboard layout types. + /// public enum KeyboardLayoutType { Unknown = 0, diff --git a/RGB.NET.Core/Devices/TypeInterfaces/IKeyboard.cs b/RGB.NET.Core/Devices/TypeInterfaces/IKeyboard.cs index dd28694..aec72f3 100644 --- a/RGB.NET.Core/Devices/TypeInterfaces/IKeyboard.cs +++ b/RGB.NET.Core/Devices/TypeInterfaces/IKeyboard.cs @@ -1,15 +1,24 @@ namespace RGB.NET.Core { /// - /// Represents a keyboard-device + /// Represents a generic keyboard-device. /// public interface IKeyboard : IRGBDevice { + /// + /// Gets the device information assiciated with this device. + /// new IKeyboardDeviceInfo DeviceInfo { get; } } + /// + /// Represents a generic keyboard device information. + /// public interface IKeyboardDeviceInfo : IRGBDeviceInfo { + /// + /// Gets the of the keyboard. + /// KeyboardLayoutType Layout { get; } } } diff --git a/RGB.NET.Core/Events/ExceptionEventArgs.cs b/RGB.NET.Core/Events/ExceptionEventArgs.cs index c5ae6bc..14ed9b0 100644 --- a/RGB.NET.Core/Events/ExceptionEventArgs.cs +++ b/RGB.NET.Core/Events/ExceptionEventArgs.cs @@ -18,8 +18,14 @@ namespace RGB.NET.Core /// public Exception Exception { get; } + /// + /// Gets a bool indicating if the exception is critical for the thrower. + /// public bool IsCritical { get; } + /// + /// Gets or sets if the exception should be thrown after the event is handled. + /// public bool Throw { get; set; } #endregion @@ -31,6 +37,8 @@ namespace RGB.NET.Core /// Initializes a new instance of the class. /// /// The which is responsible for the event-call. + /// Indicates if the exception is critical for the thrower. + /// Indicates if the exception should be thrown after the event is handled. public ExceptionEventArgs(Exception exception, bool isCritical = false, bool @throw = false) { this.Exception = exception; diff --git a/RGB.NET.Core/Events/ResolvePathEventArgs.cs b/RGB.NET.Core/Events/ResolvePathEventArgs.cs deleted file mode 100644 index 7257bf2..0000000 --- a/RGB.NET.Core/Events/ResolvePathEventArgs.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; - -namespace RGB.NET.Core -{ - public class ResolvePathEventArgs : EventArgs - { - #region Properties & Fields - - /// - /// Gets the filename used to resolve the path. - /// Also check before use. - /// - public string? RelativePart { get; } - - /// - /// Gets the filename used to resolve the path. - /// Also check before use. - /// - public string? FileName { get; } - - /// - /// Gets the relative path used to resolve the path. - /// If this is set and are unused. - /// - public string? RelativePath { get; } - - /// - /// Gets or sets the resolved path. - /// - public string FinalPath { get; set; } - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The filename used to resolve the path. - /// The filename used to resolve the path. - /// The relative part used to resolve the path. - public ResolvePathEventArgs(string relativePart, string fileName, string finalPath) - { - this.RelativePart = relativePart; - this.FileName = fileName; - this.FinalPath = finalPath; - } - - /// - /// Initializes a new instance of the class. - /// - /// The relative path used to resolve the path. - /// The relative part used to resolve the path. - public ResolvePathEventArgs(string relativePath, string finalPath) - { - this.RelativePath = relativePath; - this.FinalPath = finalPath; - } - - #endregion - } -} diff --git a/RGB.NET.Core/Events/SurfaceLayoutChangedEventArgs.cs b/RGB.NET.Core/Events/SurfaceLayoutChangedEventArgs.cs index e591385..8bbc6a2 100644 --- a/RGB.NET.Core/Events/SurfaceLayoutChangedEventArgs.cs +++ b/RGB.NET.Core/Events/SurfaceLayoutChangedEventArgs.cs @@ -43,7 +43,8 @@ namespace RGB.NET.Core /// /// The that caused the change. /// A value indicating if the event is caused by the addition of a new to the . - /// A value indicating if the event is caused by a changed location of one of the devices on the . + /// A value indicating if the event is caused by the removal of a from the . + /// A value indicating if the event is caused by a change to a on the . private SurfaceLayoutChangedEventArgs(IRGBDevice? devices, bool deviceAdded, bool deviceRemoved, bool deviceChanged) { this.Devices = devices; diff --git a/RGB.NET.Core/Exceptions/DeviceProviderException.cs b/RGB.NET.Core/Exceptions/DeviceProviderException.cs index f17afdb..6384f67 100644 --- a/RGB.NET.Core/Exceptions/DeviceProviderException.cs +++ b/RGB.NET.Core/Exceptions/DeviceProviderException.cs @@ -2,16 +2,28 @@ namespace RGB.NET.Core { + /// + /// + /// Represents an exception thrown by a . + /// public class DeviceProviderException : ApplicationException { #region Properties & Fields - private bool IsCritical { get; } + /// + /// Gets a bool indicating if the exception is critical and shouldn't be ingored. + /// + public bool IsCritical { get; } #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The exception that is the casue of the current exception or null if this exception was thrown on purpose. + /// A value indicating if the exception is critical and shouldn't be ignored. public DeviceProviderException(Exception? innerException, bool isCritical) : base(innerException?.Message, innerException) { diff --git a/RGB.NET.Core/Extensions/ColorExtensions.cs b/RGB.NET.Core/Extensions/ColorExtensions.cs index b905baf..bdca800 100644 --- a/RGB.NET.Core/Extensions/ColorExtensions.cs +++ b/RGB.NET.Core/Extensions/ColorExtensions.cs @@ -2,17 +2,20 @@ namespace RGB.NET.Core { + /// + /// Offers some extensions and helper-methods for related things. + /// public static class ColorExtensions { #region Methods /// - /// Calculates the distance between the two given colors using the redmean algorithm. + /// Calculates the distance between the two specified colors using the redmean algorithm. /// For more infos check https://www.compuphase.com/cmetric.htm /// /// The start color of the distance calculation. /// The end color fot the distance calculation. - /// + /// The redmean distance between the two specified colors. public static double DistanceTo(this in Color color1, in Color color2) { (_, byte r1, byte g1, byte b1) = color1.GetRGBBytes(); diff --git a/RGB.NET.Core/Extensions/MathExtensions.cs b/RGB.NET.Core/Extensions/MathExtensions.cs index ad098bf..a656e70 100644 --- a/RGB.NET.Core/Extensions/MathExtensions.cs +++ b/RGB.NET.Core/Extensions/MathExtensions.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; namespace RGB.NET.Core { /// - /// Offers some extensions and helper-methods for the work with floats + /// Offers some extensions and helper-methods for the work with floats. /// public static class FloatExtensions { @@ -83,18 +83,28 @@ namespace RGB.NET.Core return value; } + /// + /// Converts a normalized float value in the range [0..1] to a byte [0..255]. + /// + /// The normalized float value to convert. + /// The byte value. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte GetByteValueFromPercentage(this float percentage) { if (float.IsNaN(percentage)) return 0; percentage = percentage.Clamp(0, 1.0f); - return (byte)(percentage >= 1.0 ? 255 : percentage * 256.0); + return (byte)(percentage >= 1.0f ? 255 : percentage * 256.0f); } + /// + /// Converts a byte value [0..255] to a normalized float value in the range [0..1]. + /// + /// The byte value to convert. + /// The normalized float value. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float GetPercentageFromByteValue(this byte value) - => ((float)value) / byte.MaxValue; + => value == 255 ? 1.0f : (value / 256.0f); #endregion } diff --git a/RGB.NET.Core/Extensions/PointExtensions.cs b/RGB.NET.Core/Extensions/PointExtensions.cs index 3fdf7a7..73e52e9 100644 --- a/RGB.NET.Core/Extensions/PointExtensions.cs +++ b/RGB.NET.Core/Extensions/PointExtensions.cs @@ -2,12 +2,15 @@ namespace RGB.NET.Core { + /// + /// Offers some extensions and helper-methods for related things. + /// public static class PointExtensions { #region Methods /// - /// Moves the specified by the given amount. + /// Moves the specified by the specified amount. /// /// The to move. /// The x-ammount to move. @@ -16,7 +19,7 @@ namespace RGB.NET.Core public static Point Translate(this in Point point, float x = 0, float y = 0) => new(point.X + x, point.Y + y); /// - /// Rotates the specified by the given amuont around the given origin. + /// Rotates the specified by the specified amuont around the specified origin. /// /// The to rotate. /// The rotation. diff --git a/RGB.NET.Core/Extensions/RectangleExtensions.cs b/RGB.NET.Core/Extensions/RectangleExtensions.cs index ce5745e..4b7104a 100644 --- a/RGB.NET.Core/Extensions/RectangleExtensions.cs +++ b/RGB.NET.Core/Extensions/RectangleExtensions.cs @@ -2,12 +2,15 @@ namespace RGB.NET.Core { + /// + /// Offers some extensions and helper-methods for the work with rectangles. + /// public static class RectangleExtensions { #region Methods /// - /// Sets the of the given rectangle. + /// Sets the of the specified rectangle. /// /// The rectangle to modify. /// The new location of the rectangle. @@ -15,7 +18,7 @@ namespace RGB.NET.Core public static Rectangle SetLocation(this in Rectangle rect, in Point location) => new(location, rect.Size); /// - /// Sets the of the of the given rectangle. + /// Sets the of the of the specified rectangle. /// /// The rectangle to modify. /// The new x-location of the rectangle. @@ -23,7 +26,7 @@ namespace RGB.NET.Core public static Rectangle SetX(this in Rectangle rect, float x) => new(new Point(x, rect.Location.Y), rect.Size); /// - /// Sets the of the of the given rectangle. + /// Sets the of the of the specified rectangle. /// /// The rectangle to modify. /// The new y-location of the rectangle. @@ -31,7 +34,7 @@ namespace RGB.NET.Core public static Rectangle SetY(this in Rectangle rect, float y) => new(new Point(rect.Location.X, y), rect.Size); /// - /// Sets the of the given rectangle. + /// Sets the of the specified rectangle. /// /// The rectangle to modify. /// The new size of the rectangle. @@ -39,7 +42,7 @@ namespace RGB.NET.Core public static Rectangle SetSize(this in Rectangle rect, in Size size) => new(rect.Location, size); /// - /// Sets the of the of the given rectangle. + /// Sets the of the of the specified rectangle. /// /// The rectangle to modify. /// The new width of the rectangle. @@ -47,7 +50,7 @@ namespace RGB.NET.Core public static Rectangle SetWidth(this in Rectangle rect, float width) => new(rect.Location, new Size(width, rect.Size.Height)); /// - /// Sets the of the of the given rectangle. + /// Sets the of the of the specified rectangle. /// /// The rectangle to modify. /// The new height of the rectangle. @@ -57,6 +60,7 @@ namespace RGB.NET.Core /// /// Calculates the percentage of intersection of a rectangle. /// + /// The rectangle to calculate the intersection for. /// The intersecting rectangle. /// The percentage of intersection. public static float CalculateIntersectPercentage(this in Rectangle rect, in Rectangle intersectingRect) @@ -70,6 +74,7 @@ namespace RGB.NET.Core /// /// Calculates the representing the intersection of this and the one provided as parameter. /// + /// The rectangle to calculate the intersection for. /// The intersecting /// A new representing the intersection this and the one provided as parameter. public static Rectangle CalculateIntersection(this in Rectangle rect, in Rectangle intersectingRectangle) @@ -89,29 +94,32 @@ namespace RGB.NET.Core /// /// Determines if the specified is contained within this . /// + /// The containing rectangle. /// The to test. - /// true if the rectangle contains the given point; otherwise false. + /// true if the rectangle contains the specified point; otherwise false. public static bool Contains(this in Rectangle rect, in Point point) => rect.Contains(point.X, point.Y); /// /// Determines if the specified location is contained within this . /// + /// The containing rectangle. /// The X-location to test. /// The Y-location to test. - /// true if the rectangle contains the given coordinates; otherwise false. + /// true if the rectangle contains the specified coordinates; otherwise false. public static bool Contains(this in Rectangle rect, float x, float y) => (rect.Location.X <= x) && (x < (rect.Location.X + rect.Size.Width)) - && (rect.Location.Y <= y) && (y < (rect.Location.Y + rect.Size.Height)); + && (rect.Location.Y <= y) && (y < (rect.Location.Y + rect.Size.Height)); /// /// Determines if the specified is contained within this . /// - /// The to test. - /// true if the rectangle contains the given rect; otherwise false. + /// The containing rectangle. + /// The to test. + /// true if the rectangle contains the specified rect; otherwise false. public static bool Contains(this in Rectangle rect, in Rectangle rect2) => (rect.Location.X <= rect2.Location.X) && ((rect2.Location.X + rect2.Size.Width) <= (rect.Location.X + rect.Size.Width)) - && (rect.Location.Y <= rect2.Location.Y) && ((rect2.Location.Y + rect2.Size.Height) <= (rect.Location.Y + rect.Size.Height)); + && (rect.Location.Y <= rect2.Location.Y) && ((rect2.Location.Y + rect2.Size.Height) <= (rect.Location.Y + rect.Size.Height)); /// - /// Moves the specified by the given amount. + /// Moves the specified by the specified amount. /// /// The to move. /// The amount to move. @@ -119,7 +127,7 @@ namespace RGB.NET.Core public static Rectangle Translate(this in Rectangle rect, in Point point) => rect.Translate(point.X, point.Y); /// - /// Moves the specified by the given amount. + /// Moves the specified by the specified amount. /// /// The to move. /// The x-ammount to move. @@ -128,7 +136,7 @@ namespace RGB.NET.Core public static Rectangle Translate(this in Rectangle rect, float x = 0, float y = 0) => new(rect.Location.Translate(x, y), rect.Size); /// - /// Rotates the specified by the given amuont around the given origin. + /// Rotates the specified by the specified amuont around the specified origin. /// /// /// The returned array of is filled with the new locations of the rectangle clockwise starting from the top left: diff --git a/RGB.NET.Core/Extensions/SurfaceExtensions.cs b/RGB.NET.Core/Extensions/SurfaceExtensions.cs index fb53fc0..8b789e8 100644 --- a/RGB.NET.Core/Extensions/SurfaceExtensions.cs +++ b/RGB.NET.Core/Extensions/SurfaceExtensions.cs @@ -5,10 +5,20 @@ using System.Linq; namespace RGB.NET.Core { + /// + /// Offers some extensions and helper-methods for the work with the surface. + /// public static class SurfaceExtensions { #region Methods + /// + /// Initializes the specifiec device provider and attaches all devices. + /// + /// The surface to attach the devices to. + /// The device provider to load. + /// -flags to filter the devices to load. + /// Specifies if exceptions should be thrown or silently be ignored. public static void Load(this RGBSurface surface, IRGBDeviceProvider deviceProvider, RGBDeviceType loadFilter = RGBDeviceType.All, bool throwExceptions = false) { if (!deviceProvider.IsInitialized) @@ -17,13 +27,22 @@ namespace RGB.NET.Core surface.Attach(deviceProvider.Devices); } - + /// + /// Attaches the specified devices to the surface. + /// + /// The surface the devices are attached to. + /// The devices to attach. public static void Attach(this RGBSurface surface, IEnumerable devices) { foreach (IRGBDevice device in devices) surface.Attach(device); } + /// + /// Detaches the specified devices from the surface. + /// + /// The surface the devices are detached from. + /// The devices to detach. public static void Detach(this RGBSurface surface, IEnumerable devices) { foreach (IRGBDevice device in devices) @@ -42,6 +61,7 @@ namespace RGB.NET.Core /// /// Gets all devices of the specified . /// + /// The surface to get the devices from. /// The of the devices to get. /// A collection of devices matching the specified . public static IEnumerable GetDevices(this RGBSurface surface, RGBDeviceType deviceType) diff --git a/RGB.NET.Core/Groups/AbstractLedGroup.cs b/RGB.NET.Core/Groups/AbstractLedGroup.cs index c035937..c42de03 100644 --- a/RGB.NET.Core/Groups/AbstractLedGroup.cs +++ b/RGB.NET.Core/Groups/AbstractLedGroup.cs @@ -13,6 +13,8 @@ namespace RGB.NET.Core #region Properties & Fields RGBSurface? ILedGroup.Surface { get; set; } + + /// public RGBSurface? Surface => ((ILedGroup)this).Surface; /// @@ -37,6 +39,10 @@ namespace RGB.NET.Core #region Methods + /// + /// Gets a enumerable containing all leds in this group. + /// + /// protected abstract IEnumerable GetLeds(); /// diff --git a/RGB.NET.Core/Groups/ILedGroup.cs b/RGB.NET.Core/Groups/ILedGroup.cs index adcf9b7..94d4a95 100644 --- a/RGB.NET.Core/Groups/ILedGroup.cs +++ b/RGB.NET.Core/Groups/ILedGroup.cs @@ -10,8 +10,14 @@ namespace RGB.NET.Core /// public interface ILedGroup : IDecoratable, IEnumerable { + /// + /// Gets the surface this group is attached to or null if it is not attached to any surface. + /// RGBSurface? Surface { get; internal set; } + /// + /// Gets a bool indicating if the group is attached to a surface. + /// bool IsAttached => Surface != null; /// diff --git a/RGB.NET.Core/Groups/LedGroupExtension.cs b/RGB.NET.Core/Groups/LedGroupExtension.cs index 3d29d4c..5565d59 100644 --- a/RGB.NET.Core/Groups/LedGroupExtension.cs +++ b/RGB.NET.Core/Groups/LedGroupExtension.cs @@ -9,7 +9,7 @@ namespace RGB.NET.Core public static class LedGroupExtension { /// - /// Converts the given to a . + /// Converts the specified to a . /// /// The to convert. /// The converted . @@ -26,7 +26,7 @@ namespace RGB.NET.Core } /// - /// Returns a new which contains all from the given excluding the specified ones. + /// Returns a new which contains all from the specified excluding the specified ones. /// /// The base . /// The to exclude. @@ -41,14 +41,15 @@ namespace RGB.NET.Core // ReSharper disable once UnusedMethodReturnValue.Global /// - /// Attaches the given to the . + /// Attaches the specified to the . /// /// The to attach. + /// The to attach this group to. /// true if the could be attached; otherwise, false. public static bool Attach(this ILedGroup ledGroup, RGBSurface surface) => surface.Attach(ledGroup); /// - /// Detaches the given from the . + /// Detaches the specified from the . /// /// The to attach. /// true if the could be detached; otherwise, false. diff --git a/RGB.NET.Core/Groups/ListLedGroup.cs b/RGB.NET.Core/Groups/ListLedGroup.cs index 06e28ae..872c492 100644 --- a/RGB.NET.Core/Groups/ListLedGroup.cs +++ b/RGB.NET.Core/Groups/ListLedGroup.cs @@ -26,7 +26,7 @@ namespace RGB.NET.Core /// /// Initializes a new instance of the class. /// - /// Specifies whether this should be automatically attached or not. + /// Specifies the surface to attach this group to or null if the group should not be attached on creation. public ListLedGroup(RGBSurface? surface) : base(surface) { } @@ -35,7 +35,7 @@ namespace RGB.NET.Core /// /// Initializes a new instance of the class. /// - /// Specifies whether this should be automatically attached or not. + /// Specifies the surface to attach this group to or null if the group should not be attached on creation. /// The initial of this . public ListLedGroup(RGBSurface? surface, IEnumerable leds) : base(surface) @@ -47,7 +47,7 @@ namespace RGB.NET.Core /// /// Initializes a new instance of the class. /// - /// Specifies whether this should be automatically attached or not. + /// Specifies the surface to attach this group to or null if the group should not be attached on creation. /// The initial of this . public ListLedGroup(RGBSurface? surface, params Led[] leds) : base(surface) @@ -60,13 +60,13 @@ namespace RGB.NET.Core #region Methods /// - /// Adds the given LED(s) to this . + /// Adds the specified LED(s) to this . /// /// The LED(s) to add. public void AddLed(params Led[] leds) => AddLeds(leds); /// - /// Adds the given to this . + /// Adds the specified to this . /// /// The to add. public void AddLeds(IEnumerable leds) @@ -78,13 +78,13 @@ namespace RGB.NET.Core } /// - /// Removes the given LED(s) from this . + /// Removes the specified LED(s) from this . /// /// The LED(s) to remove. public void RemoveLed(params Led[] leds) => RemoveLeds(leds); /// - /// Removes the given from this . + /// Removes the specified from this . /// /// The to remove. public void RemoveLeds(IEnumerable leds) @@ -95,7 +95,7 @@ namespace RGB.NET.Core } /// - /// Checks if a given LED is contained by this ledgroup. + /// Checks if a specified LED is contained by this ledgroup. /// /// The LED which should be checked. /// true if the LED is contained by this ledgroup; otherwise, false. @@ -106,7 +106,7 @@ namespace RGB.NET.Core } /// - /// Merges the from the given ledgroup in this ledgroup. + /// Merges the from the specified ledgroup in this ledgroup. /// /// The ledgroup to merge. public void MergeLeds(ILedGroup groupToMerge) diff --git a/RGB.NET.Core/Helper/DeviceHelper.cs b/RGB.NET.Core/Helper/DeviceHelper.cs index cb2f358..99dbb96 100644 --- a/RGB.NET.Core/Helper/DeviceHelper.cs +++ b/RGB.NET.Core/Helper/DeviceHelper.cs @@ -3,10 +3,22 @@ using System.Runtime.CompilerServices; namespace RGB.NET.Core { + /// + /// Offsers some helper methods for device creation. + /// public static class DeviceHelper { #region Methods + /// + /// Creates a unique device name from a manufacturer and model name. + /// + /// + /// The id is made unique based on the assembly calling this method. + /// + /// The manufacturer of the device. + /// The model of the device. + /// The unique identifier for this device. [MethodImpl(MethodImplOptions.NoInlining)] public static string CreateDeviceName(string manufacturer, string model) => IdGenerator.MakeUnique(Assembly.GetCallingAssembly(), $"{manufacturer} {model}"); diff --git a/RGB.NET.Core/Ids/IdGenerator.cs b/RGB.NET.Core/Ids/IdGenerator.cs index cb68c41..27f21c4 100644 --- a/RGB.NET.Core/Ids/IdGenerator.cs +++ b/RGB.NET.Core/Ids/IdGenerator.cs @@ -4,6 +4,9 @@ using System.Runtime.CompilerServices; namespace RGB.NET.Core { + /// + /// Offers some methods to create and handle unique identifiers. + /// public static class IdGenerator { #region Properties & Fields @@ -18,6 +21,11 @@ namespace RGB.NET.Core #region Methods + /// + /// Makes the specified id unique based on the calling assembly by adding a counter if needed. + /// + /// The id to make unique. + /// The unique id. [MethodImpl(MethodImplOptions.NoInlining)] public static string MakeUnique(string id) => MakeUnique(Assembly.GetCallingAssembly(), id); @@ -49,6 +57,10 @@ namespace RGB.NET.Core return counter <= 1 ? mappedId : $"{mappedId} ({counter})"; } + /// + /// Resets the counter used to create unique ids. + /// All previous generated ids are not garantueed to stay unique if this is called! + /// [MethodImpl(MethodImplOptions.NoInlining)] public static void ResetCounter() => ResetCounter(Assembly.GetCallingAssembly()); diff --git a/RGB.NET.Core/Leds/Led.cs b/RGB.NET.Core/Leds/Led.cs index 33ea3da..4717724 100644 --- a/RGB.NET.Core/Leds/Led.cs +++ b/RGB.NET.Core/Leds/Led.cs @@ -96,6 +96,9 @@ namespace RGB.NET.Core /// public object? CustomData { get; } + /// + /// Gets or sets some custom metadata of this led. + /// public object? LayoutMetadata { get; set; } #endregion @@ -124,6 +127,7 @@ namespace RGB.NET.Core #region Methods + /// protected override void UpdateActualPlaceableData() { base.UpdateActualPlaceableData(); diff --git a/RGB.NET.Core/Leds/LedMapping.cs b/RGB.NET.Core/Leds/LedMapping.cs index 0c980d1..d75802a 100644 --- a/RGB.NET.Core/Leds/LedMapping.cs +++ b/RGB.NET.Core/Leds/LedMapping.cs @@ -4,6 +4,10 @@ using System.Linq; namespace RGB.NET.Core { + /// + /// Represents a mapping from to a custom identifier. + /// + /// The identifier the is mapped to. public class LedMapping : IEnumerable<(LedId ledId, T mapping)> where T : notnull { @@ -12,15 +16,30 @@ namespace RGB.NET.Core private readonly Dictionary _mapping = new(); private readonly Dictionary _reverseMapping = new(); + /// + /// Gets the number of entries in this mapping. + /// public int Count => _mapping.Count; + /// + /// Gets a collection of all mapped ledids. + /// public ICollection LedIds => _mapping.Keys; + + /// + /// Gets a collection of all mapped custom identifiers. + /// public ICollection Mappings => _reverseMapping.Keys; #endregion #region Indexer + /// + /// Gets the custom identifier mapped to the specified . + /// + /// The led id to get the mapped identifier. + /// The mapped ifentifier. public T this[LedId ledId] { get => _mapping[ledId]; @@ -31,6 +50,11 @@ namespace RGB.NET.Core } } + /// + /// Gets the mapped to the specified custom identifier. + /// + /// The custom identifier to get the mapped led id. + /// The led id. public LedId this[T mapping] { get => _reverseMapping[mapping]; @@ -41,18 +65,52 @@ namespace RGB.NET.Core #region Methods + /// + /// Adds a new entry to the mapping. + /// + /// The to map. + /// The custom identifier to map. public void Add(LedId ledId, T mapping) { _mapping.Add(ledId, mapping); _reverseMapping.Add(mapping, ledId); } + /// + /// Checks if the specified is mapped. + /// + /// The led id to check. + /// true if the led id is mapped; otherwise false. public bool Contains(LedId ledId) => _mapping.ContainsKey(ledId); + + /// + /// Checks if the specified custom identifier is mapped. + /// + /// The custom identifier to check. + /// true if the led id is mapped; otherwise false. public bool Contains(T mapping) => _reverseMapping.ContainsKey(mapping); + /// + /// Gets the custom identifier mapped to the specified led id. + /// + /// The led id to get the custom identifier for. + /// Contains the mapped custom identifier or null if there is no mapping for the specified led id. + /// true if there was a custom identifier for the specified led id; otherwise false. public bool TryGetValue(LedId ledId, out T? mapping) => _mapping.TryGetValue(ledId, out mapping); + + /// + /// Gets the led id mapped to the specified custom identifier. + /// + /// The custom identifier to get the led id for. + /// Contains the mapped led id or null if there is no mapping for the specified led id. + /// true if there was a led id for the specified custom identifier; otherwise false. public bool TryGetValue(T mapping, out LedId ledId) => _reverseMapping.TryGetValue(mapping, out ledId); + /// + /// Removes the specified led id and the mapped custom identifier. + /// + /// The led id to remove. + /// true if there was a mapping for the led id to remove; otherwise false. public bool Remove(LedId ledId) { if (_mapping.TryGetValue(ledId, out T? mapping)) @@ -60,6 +118,11 @@ namespace RGB.NET.Core return _mapping.Remove(ledId); } + /// + /// Removes the specified custom identifier and the mapped led id. + /// + /// The custom identifier to remove. + /// true if there was a mapping for the custom identifier to remove; otherwise false. public bool Remove(T mapping) { if (_reverseMapping.TryGetValue(mapping, out LedId ledId)) @@ -67,6 +130,9 @@ namespace RGB.NET.Core return _reverseMapping.Remove(mapping); } + /// + /// Removes all registered mappings. + /// public void Clear() { _mapping.Clear(); @@ -74,6 +140,8 @@ namespace RGB.NET.Core } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + /// public IEnumerator<(LedId ledId, T mapping)> GetEnumerator() => _mapping.Select(x => (x.Key, x.Value)).GetEnumerator(); #endregion diff --git a/RGB.NET.Core/Positioning/IPlaceable.cs b/RGB.NET.Core/Positioning/IPlaceable.cs index d7e116f..dcc3a17 100644 --- a/RGB.NET.Core/Positioning/IPlaceable.cs +++ b/RGB.NET.Core/Positioning/IPlaceable.cs @@ -4,6 +4,9 @@ using System; namespace RGB.NET.Core { + /// + /// Represents a generic placeable element. + /// public interface IPlaceable { #region Properties & Fields @@ -50,12 +53,39 @@ namespace RGB.NET.Core #region Events + /// + /// Occurs when the property was changed. + /// event EventHandler LocationChanged; + + /// + /// Occurs when the property was changed. + /// event EventHandler SizeChanged; + + /// + /// Occurs when the property was changed. + /// event EventHandler ScaleChanged; + + /// + /// Occurs when the property was changed. + /// event EventHandler RotationChanged; + + /// + /// Occurs when the property was changed. + /// event EventHandler ActualLocationChanged; + + /// + /// Occurs when the property was changed. + /// event EventHandler ActualSizeChanged; + + /// + /// Occurs when the property was changed. + /// event EventHandler BoundaryChanged; #endregion diff --git a/RGB.NET.Core/Positioning/Placeable.cs b/RGB.NET.Core/Positioning/Placeable.cs index f415f48..3aa5431 100644 --- a/RGB.NET.Core/Positioning/Placeable.cs +++ b/RGB.NET.Core/Positioning/Placeable.cs @@ -2,10 +2,16 @@ namespace RGB.NET.Core { + /// + /// Represents a placeable element. + /// public class Placeable : AbstractBindable, IPlaceable { #region Properties & Fields + /// + /// Gets the parent this placeable is placed in. + /// protected IPlaceable? Parent { get; } private Point _location = Point.Invalid; @@ -96,20 +102,40 @@ namespace RGB.NET.Core #region Events + /// public event EventHandler? LocationChanged; + + /// public event EventHandler? SizeChanged; + + /// public event EventHandler? ScaleChanged; + + /// public event EventHandler? RotationChanged; + + /// public event EventHandler? ActualLocationChanged; + + /// public event EventHandler? ActualSizeChanged; + + /// public event EventHandler? BoundaryChanged; #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// public Placeable() { } + /// + /// Initializes a new instance of the class. + /// + /// The parent this placeable is placed in. public Placeable(IPlaceable parent) { this.Parent = parent; @@ -117,12 +143,23 @@ namespace RGB.NET.Core Parent.BoundaryChanged += (_, _) => UpdateActualPlaceableData(); } + /// + /// Initializes a new instance of the class. + /// + /// The location of this placeable. + /// The size of this placeable. public Placeable(Point location, Size size) { this.Location = location; this.Size = size; } + /// + /// Initializes a new instance of the class. + /// + /// The parent placeable this placeable is placed in. + /// The location of this placeable. + /// The size of this placeable. public Placeable(IPlaceable parent, Point location, Size size) { this.Parent = parent; @@ -136,6 +173,9 @@ namespace RGB.NET.Core #region Methods + /// + /// Updates the , and based on the , and . + /// protected virtual void UpdateActualPlaceableData() { if (Parent != null) @@ -166,32 +206,55 @@ namespace RGB.NET.Core } } + /// + /// Called when the property was changed. + /// protected virtual void OnLocationChanged() { LocationChanged?.Invoke(this, new EventArgs()); UpdateActualPlaceableData(); } + /// + /// Called when the property was changed. + /// protected virtual void OnSizeChanged() { SizeChanged?.Invoke(this, new EventArgs()); UpdateActualPlaceableData(); } + /// + /// Called when the property was changed. + /// protected virtual void OnScaleChanged() { ScaleChanged?.Invoke(this, new EventArgs()); UpdateActualPlaceableData(); } + /// + /// Called when the property was changed. + /// protected virtual void OnRotationChanged() { RotationChanged?.Invoke(this, new EventArgs()); UpdateActualPlaceableData(); } + /// + /// Called when the property was changed. + /// protected virtual void OnActualLocationChanged() => ActualLocationChanged?.Invoke(this, new EventArgs()); + + /// + /// Called when the property was changed. + /// protected virtual void OnActualSizeChanged() => ActualSizeChanged?.Invoke(this, new EventArgs()); + + /// + /// Called when the property was changed. + /// protected virtual void OnBoundaryChanged() => BoundaryChanged?.Invoke(this, new EventArgs()); #endregion diff --git a/RGB.NET.Core/Positioning/Rectangle.cs b/RGB.NET.Core/Positioning/Rectangle.cs index 3c545e6..466c312 100644 --- a/RGB.NET.Core/Positioning/Rectangle.cs +++ b/RGB.NET.Core/Positioning/Rectangle.cs @@ -54,14 +54,14 @@ namespace RGB.NET.Core { } /// - /// Initializes a new instance of the class using the (0,0) and the given . + /// Initializes a new instance of the class using the (0,0) and the specified . /// /// The size of of this . public Rectangle(Size size) : this(new Point(), size) { } /// - /// Initializes a new instance of the class using the given and . + /// Initializes a new instance of the class using the specified and . /// /// The location of this of this . /// The size of of this . @@ -75,7 +75,7 @@ namespace RGB.NET.Core /// /// - /// Initializes a new instance of the class using the given array of . + /// Initializes a new instance of the class using the specified array of . /// The and is calculated to completely contain all rectangles provided as parameters. /// /// The array of used to calculate the and @@ -84,7 +84,7 @@ namespace RGB.NET.Core { } /// - /// Initializes a new instance of the class using the given list of . + /// Initializes a new instance of the class using the specified list of . /// The and is calculated to completely contain all rectangles provided as parameters. /// /// The list of used to calculate the and @@ -113,7 +113,7 @@ namespace RGB.NET.Core /// /// - /// Initializes a new instance of the class using the given array of . + /// Initializes a new instance of the class using the specified array of . /// The and is calculated to contain all points provided as parameters. /// /// The array of used to calculate the and @@ -123,7 +123,7 @@ namespace RGB.NET.Core /// /// - /// Initializes a new instance of the class using the given list of . + /// Initializes a new instance of the class using the specified list of . /// The and is calculated to contain all points provided as parameters. /// /// The list of used to calculate the and @@ -223,6 +223,12 @@ namespace RGB.NET.Core public static bool operator !=(in Rectangle rectangle1, in Rectangle rectangle2) => !(rectangle1 == rectangle2); // DarthAffe 20.02.2021: Used for normalization + /// + /// Returns a normalized to the specified reference. + /// + /// The rectangle to nromalize. + /// The reference used for normalization. + /// A normalized rectangle. public static Rectangle operator /(in Rectangle rectangle1, in Rectangle rectangle2) { float x = rectangle1.Location.X / (rectangle2.Size.Width - rectangle2.Location.X); diff --git a/RGB.NET.Core/Positioning/Rotation.cs b/RGB.NET.Core/Positioning/Rotation.cs index 39a5315..8b024ae 100644 --- a/RGB.NET.Core/Positioning/Rotation.cs +++ b/RGB.NET.Core/Positioning/Rotation.cs @@ -44,7 +44,7 @@ namespace RGB.NET.Core /// /// Initializes a new instance of the class using the provided values. /// - /// The rotation in degrees. + /// The rotation in degrees. public Rotation(float degrees) : this(degrees, degrees * DEGREES_RADIANS_CONVERSION) { } @@ -60,16 +60,16 @@ namespace RGB.NET.Core #region Methods /// - /// Creates a new Rotation out of the given degree-angle. + /// Creates a new Rotation out of the specified degree-angle. /// /// The angle in degrees. /// The new rotation. public static Rotation FromDegrees(float degrees) => new(degrees); /// - /// Creates a new Rotation out of the given radian-angle. + /// Creates a new Rotation out of the specified radian-angle. /// - /// The angle in radians. + /// The angle in radians. /// The new rotation. public static Rotation FromRadians(float radians) => new(radians * RADIANS_DEGREES_CONVERSION, radians); diff --git a/RGB.NET.Core/Positioning/Size.cs b/RGB.NET.Core/Positioning/Size.cs index 3a8c279..b4a77ac 100644 --- a/RGB.NET.Core/Positioning/Size.cs +++ b/RGB.NET.Core/Positioning/Size.cs @@ -74,7 +74,7 @@ namespace RGB.NET.Core /// true if is a equivalent to this ; otherwise, false. public override bool Equals(object? obj) { - if (!(obj is Size size)) return false; + if (obj is not Size size) return false; (float width, float height) = size; return ((float.IsNaN(Width) && float.IsNaN(width)) || Width.EqualsInTolerance(width)) @@ -185,11 +185,11 @@ namespace RGB.NET.Core public static Size operator /(in Size size, float factor) => factor.EqualsInTolerance(0) ? Invalid : new Size(size.Width / factor, size.Height / factor); /// - /// Returns a new representing the multiplication of the and the given . + /// Returns a new representing the multiplication of the and the specified . /// /// The to scale. /// The scaling factor. - /// A new representing the multiplication of the and the given . + /// A new representing the multiplication of the and the specified . public static Size operator *(in Size size, in Scale scale) => new(size.Width * scale.Horizontal, size.Height * scale.Vertical); #endregion diff --git a/RGB.NET.Core/RGBSurface.cs b/RGB.NET.Core/RGBSurface.cs index 34eabd3..669c044 100644 --- a/RGB.NET.Core/RGBSurface.cs +++ b/RGB.NET.Core/RGBSurface.cs @@ -225,7 +225,7 @@ namespace RGB.NET.Core } /// - /// Attaches the given . + /// Attaches the specified . /// /// The to attach. /// true if the could be attached; otherwise, false. @@ -245,10 +245,10 @@ namespace RGB.NET.Core } /// - /// Detaches the given . + /// Detaches the specified . /// - /// The to detached. - /// true if the could be detached; otherwise, false. + /// The to detache. + /// true if the could be detached; false otherwise. public bool Detach(ILedGroup ledGroup) { lock (_ledGroups) @@ -261,6 +261,10 @@ namespace RGB.NET.Core } } + /// + /// Attaches the specified . + /// + /// The to attach. public void Attach(IRGBDevice device) { lock (_devices) @@ -276,6 +280,11 @@ namespace RGB.NET.Core } } + /// + /// Detaches the specified . + /// + /// The to detache. + /// true if the could be detached; false otherwise. public void Detach(IRGBDevice device) { lock (_devices) diff --git a/RGB.NET.Core/Rendering/Brushes/AbstractBrush.cs b/RGB.NET.Core/Rendering/Brushes/AbstractBrush.cs index e4d7274..1e988e6 100644 --- a/RGB.NET.Core/Rendering/Brushes/AbstractBrush.cs +++ b/RGB.NET.Core/Rendering/Brushes/AbstractBrush.cs @@ -46,6 +46,12 @@ namespace RGB.NET.Core #region Methods + /// + /// Renders the brush to the specified list of . + /// + /// The bounding box the brush is rendered in. + /// The targets to render to. + /// A enumerable containing the rendered for each . public virtual IEnumerable<(RenderTarget renderTarget, Color color)> Render(Rectangle rectangle, IEnumerable renderTargets) { foreach (RenderTarget renderTarget in renderTargets) @@ -74,7 +80,7 @@ namespace RGB.NET.Core } /// - /// Gets the color at an specific point assuming the brush is drawn into the given rectangle. + /// Gets the color at an specific point assuming the brush is drawn into the specified rectangle. /// /// The rectangle in which the brush should be drawn. /// The target (key/point) from which the color should be taken. diff --git a/RGB.NET.Core/Rendering/Brushes/SolidColorBrush.cs b/RGB.NET.Core/Rendering/Brushes/SolidColorBrush.cs index aaf9409..444c90c 100644 --- a/RGB.NET.Core/Rendering/Brushes/SolidColorBrush.cs +++ b/RGB.NET.Core/Rendering/Brushes/SolidColorBrush.cs @@ -24,8 +24,7 @@ namespace RGB.NET.Core #endregion #region Constructors - - /// + /// /// Initializes a new instance of the class. /// diff --git a/RGB.NET.Core/Rendering/Brushes/TextureBrush.cs b/RGB.NET.Core/Rendering/Brushes/TextureBrush.cs index 2ec8f05..f67b090 100644 --- a/RGB.NET.Core/Rendering/Brushes/TextureBrush.cs +++ b/RGB.NET.Core/Rendering/Brushes/TextureBrush.cs @@ -1,10 +1,17 @@ namespace RGB.NET.Core { + /// + /// + /// Represents a brush drawing a texture. + /// public class TextureBrush : AbstractBrush { #region Properties & Fields private ITexture _texture = ITexture.Empty; + /// + /// Gets or sets the texture drawn by this brush. + /// public ITexture Texture { get => _texture; @@ -15,6 +22,10 @@ #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The texture drawn by this brush. public TextureBrush(ITexture texture) { this.Texture = texture; @@ -24,6 +35,7 @@ #region Methods + /// protected override Color GetColorAtPoint(in Rectangle rectangle, in RenderTarget renderTarget) { Rectangle normalizedRect = renderTarget.Rectangle / rectangle; diff --git a/RGB.NET.Core/Rendering/Textures/ITexture.cs b/RGB.NET.Core/Rendering/Textures/ITexture.cs index 7d297e1..4ef1114 100644 --- a/RGB.NET.Core/Rendering/Textures/ITexture.cs +++ b/RGB.NET.Core/Rendering/Textures/ITexture.cs @@ -1,12 +1,32 @@ namespace RGB.NET.Core { + /// + /// Represents a generic texture. + /// public interface ITexture { + /// + /// Gets a empty texture. + /// static ITexture Empty => new EmptyTexture(); - + + /// + /// Gets the size of the texture + /// Size Size { get; } + /// + /// Gets the color at the specified location. + /// + /// The location to get the color from. + /// The color at the specified location. Color this[in Point point] { get; } + + /// + /// Gets the sampled color inside the specified rectangle. + /// + /// The rectangle to get the color from. + /// The sampled color. Color this[in Rectangle rectangle] { get; } } } diff --git a/RGB.NET.Core/Rendering/Textures/PixelTexture.cs b/RGB.NET.Core/Rendering/Textures/PixelTexture.cs index f5f1719..4164a5e 100644 --- a/RGB.NET.Core/Rendering/Textures/PixelTexture.cs +++ b/RGB.NET.Core/Rendering/Textures/PixelTexture.cs @@ -4,6 +4,11 @@ using System.Runtime.CompilerServices; namespace RGB.NET.Core { + /// + /// + /// Represents a texture made of pixels (like a common image). + /// + /// The type of the pixels. public abstract class PixelTexture : ITexture where T : unmanaged { @@ -18,11 +23,20 @@ namespace RGB.NET.Core private readonly int _dataPerPixel; private readonly int _stride; + /// + /// Gets or sets the sampler used to get the color of a region. + /// public ISampler Sampler { get; set; } + + /// public Size Size { get; } + /// + /// Gets the underlying pixel data. + /// protected abstract ReadOnlySpan Data { get; } + /// public virtual Color this[in Point point] { get @@ -35,6 +49,7 @@ namespace RGB.NET.Core } } + /// public virtual Color this[in Rectangle rectangle] { get @@ -50,6 +65,14 @@ namespace RGB.NET.Core } } + /// + /// Gets the sampled color inside the specified region. + /// + /// The x-location of the region. + /// The y-location of the region. + /// The with of the region. + /// The height of the region. + /// The sampled color. public virtual Color this[int x, int y, int width, int height] { get @@ -66,7 +89,7 @@ namespace RGB.NET.Core GetRegionData(x, y, width, height, buffer); Span pixelData = stackalloc T[_dataPerPixel]; - Sampler.SampleColor(new SamplerInfo(width, height, buffer), pixelData); + Sampler.Sample(new SamplerInfo(width, height, buffer), pixelData); return GetColor(pixelData); } @@ -78,7 +101,7 @@ namespace RGB.NET.Core GetRegionData(x, y, width, height, buffer); Span pixelData = stackalloc T[_dataPerPixel]; - Sampler.SampleColor(new SamplerInfo(width, height, buffer), pixelData); + Sampler.Sample(new SamplerInfo(width, height, buffer), pixelData); ArrayPool.Shared.Return(rent); @@ -91,6 +114,14 @@ namespace RGB.NET.Core #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The width of the texture. + /// The height of the texture. + /// The amount of data-entries per pixel. + /// The sampler used to get the color of a region. + /// The stride of the data or -1 if the width should be used. public PixelTexture(int with, int height, int dataPerPixel, ISampler sampler, int stride = -1) { this._stride = stride == -1 ? with : stride; @@ -104,11 +135,30 @@ namespace RGB.NET.Core #region Methods + /// + /// Converts the pixel-data to a color. + /// + /// The pixel-data to convert. + /// The color represented by the specified pixel-data. protected abstract Color GetColor(in ReadOnlySpan pixel); + /// + /// Gets the pixel-data at the specified location. + /// + /// The x-location. + /// The y-location. + /// The pixel-data on the specified location. [MethodImpl(MethodImplOptions.AggressiveInlining)] protected virtual ReadOnlySpan GetPixelData(int x, int y) => Data.Slice((y * _stride) + x, _dataPerPixel); + /// + /// Writes the pixel-data of the specified region to the passed buffer. + /// + /// The x-location of the region to get the data for. + /// The y-location of the region to get the data for. + /// The width of the region to get the data for. + /// The height of the region to get the data for. + /// The buffer to write the data to. protected virtual void GetRegionData(int x, int y, int width, int height, in Span buffer) { int dataWidth = width * _dataPerPixel; @@ -124,34 +174,54 @@ namespace RGB.NET.Core #endregion } + /// + /// + /// Represents a texture made of color-pixels. + /// public sealed class PixelTexture : PixelTexture { #region Properties & Fields private readonly Color[] _data; + /// protected override ReadOnlySpan Data => _data; #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// A is used. + /// + /// The width of the texture. + /// The height of the texture. + /// The pixel-data of the texture. public PixelTexture(int with, int height, Color[] data) : this(with, height, data, new AverageColorSampler()) { } + /// + /// Initializes a new instance of the class. + /// + /// The width of the texture. + /// The height of the texture. + /// The pixel-data of the texture. + /// The sampler used to get the color of a region. public PixelTexture(int with, int height, Color[] data, ISampler sampler) : base(with, height, 1, sampler) { this._data = data; - if (Data.Length != (with * height)) throw new ArgumentException($"Data-Length {Data.Length} differs from the given size {with}x{height} ({with * height})."); + if (Data.Length != (with * height)) throw new ArgumentException($"Data-Length {Data.Length} differs from the specified size {with}x{height} ({with * height})."); } #endregion #region Methods + /// protected override Color GetColor(in ReadOnlySpan pixel) => pixel[0]; #endregion diff --git a/RGB.NET.Core/Rendering/Textures/Sampler/AverageColorSampler.cs b/RGB.NET.Core/Rendering/Textures/Sampler/AverageColorSampler.cs index 4910dbc..c1e8ed2 100644 --- a/RGB.NET.Core/Rendering/Textures/Sampler/AverageColorSampler.cs +++ b/RGB.NET.Core/Rendering/Textures/Sampler/AverageColorSampler.cs @@ -2,11 +2,18 @@ namespace RGB.NET.Core { + /// + /// Represents a sampled that averages multiple color to a single color. + /// + /// + /// Averages all components (A, R, G, B) of the colors separately which isn't ideal in cases where multiple different colors are combined. + /// public class AverageColorSampler : ISampler { #region Methods - public void SampleColor(in SamplerInfo info, in Span pixelData) + /// + public void Sample(in SamplerInfo info, in Span pixelData) { int count = info.Width * info.Height; if (count == 0) return; diff --git a/RGB.NET.Core/Rendering/Textures/Sampler/ISampler.cs b/RGB.NET.Core/Rendering/Textures/Sampler/ISampler.cs index ce507bd..aa89a14 100644 --- a/RGB.NET.Core/Rendering/Textures/Sampler/ISampler.cs +++ b/RGB.NET.Core/Rendering/Textures/Sampler/ISampler.cs @@ -2,8 +2,17 @@ namespace RGB.NET.Core { + /// + /// Represents a generic sampler to combine multipel data entries to a single one. + /// + /// The type of the data to sample. public interface ISampler { - void SampleColor(in SamplerInfo info, in Span pixelData); + /// + /// Samples the specified data to a single pixel-buffer. + /// + /// The information containing the data to sample. + /// The buffer used to write the resulting pixel to. + void Sample(in SamplerInfo info, in Span pixelData); } } diff --git a/RGB.NET.Core/Rendering/Textures/Sampler/SamplerInfo.cs b/RGB.NET.Core/Rendering/Textures/Sampler/SamplerInfo.cs index a544381..9eff14b 100644 --- a/RGB.NET.Core/Rendering/Textures/Sampler/SamplerInfo.cs +++ b/RGB.NET.Core/Rendering/Textures/Sampler/SamplerInfo.cs @@ -2,18 +2,39 @@ namespace RGB.NET.Core { + /// + /// Represents the information used to sample data. + /// + /// The type of the data to sample. public readonly ref struct SamplerInfo { #region Properties & Fields + /// + /// Gets the width of the region the data comes from. + /// public int Width { get; } + + /// + /// Gets the height of region the data comes from. + /// public int Height { get; } + + /// + /// Gets the data to sample. + /// public ReadOnlySpan Data { get; } #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The width of the region the data comes from. + /// The height of region the data comes from. + /// The data to sample. public SamplerInfo(int width, int height, ReadOnlySpan data) { this.Width = width; diff --git a/RGB.NET.Core/Update/CustomUpdateData.cs b/RGB.NET.Core/Update/CustomUpdateData.cs index 0c14e77..c5b5c1c 100644 --- a/RGB.NET.Core/Update/CustomUpdateData.cs +++ b/RGB.NET.Core/Update/CustomUpdateData.cs @@ -19,7 +19,7 @@ namespace RGB.NET.Core /// Gets or sets the value for a specific key. /// /// The key of the value. - /// The value represented by the given key. + /// The value represented by the specified key. public object? this[string key] { get => _data.TryGetValue(key.ToUpperInvariant(), out object? data) ? data : default; diff --git a/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs b/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs index 4ae41cd..d70cb63 100644 --- a/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs +++ b/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs @@ -53,13 +53,32 @@ namespace RGB.NET.Core } } + /// public override double LastUpdateTime { get; protected set; } + /// + /// Gets or sets the event to trigger when new data is available (). + /// protected AutoResetEvent HasDataEvent { get; set; } = new(false); + /// + /// Gets or sets a bool indicating if the trigger is currently updating. + /// protected bool IsRunning { get; set; } + + /// + /// Gets or sets the update loop of this trigger. + /// protected Task? UpdateTask { get; set; } + + /// + /// Gets or sets the cancellation token source used to create the cancellation token checked by the . + /// protected CancellationTokenSource? UpdateTokenSource { get; set; } + + /// + /// Gets or sets the cancellation token checked by the . + /// protected CancellationToken UpdateToken { get; set; } #endregion @@ -116,6 +135,9 @@ namespace RGB.NET.Core UpdateTask = null; } + /// + /// The update loop called by the . + /// protected virtual void UpdateLoop() { OnStartup(); diff --git a/RGB.NET.Core/Update/Devices/IUpdateQueue.cs b/RGB.NET.Core/Update/Devices/IUpdateQueue.cs index 0fbcd7a..16ddef4 100644 --- a/RGB.NET.Core/Update/Devices/IUpdateQueue.cs +++ b/RGB.NET.Core/Update/Devices/IUpdateQueue.cs @@ -3,6 +3,11 @@ using System.Collections.Generic; namespace RGB.NET.Core { + /// + /// Represents a generic update queue. + /// + /// The identifier used to identify the data processed by this queue. + /// The type of the data processed by this queue. public interface IUpdateQueue : IDisposable where TIdentifier : notnull { @@ -19,6 +24,9 @@ namespace RGB.NET.Core void Reset(); } + /// + /// Represents a generic update queue processing -data using -identifiers. + /// public interface IUpdateQueue : IUpdateQueue { } } diff --git a/RGB.NET.Core/Update/IUpdateTrigger.cs b/RGB.NET.Core/Update/IUpdateTrigger.cs index 0af6d33..d0c52dc 100644 --- a/RGB.NET.Core/Update/IUpdateTrigger.cs +++ b/RGB.NET.Core/Update/IUpdateTrigger.cs @@ -7,6 +7,9 @@ namespace RGB.NET.Core /// public interface IUpdateTrigger : IDisposable { + /// + /// Gets the time spent for the last update. + /// double LastUpdateTime { get; } /// @@ -19,6 +22,9 @@ namespace RGB.NET.Core /// event EventHandler? Update; + /// + /// Starts the update trigger. + /// void Start(); } } diff --git a/RGB.NET.Core/Update/ManualUpdateTrigger.cs b/RGB.NET.Core/Update/ManualUpdateTrigger.cs index 96877cb..eaece84 100644 --- a/RGB.NET.Core/Update/ManualUpdateTrigger.cs +++ b/RGB.NET.Core/Update/ManualUpdateTrigger.cs @@ -8,7 +8,7 @@ namespace RGB.NET.Core { /// /// - /// Represents an + /// Represents an update trigger that is manully triggered by calling . /// public sealed class ManualUpdateTrigger : AbstractUpdateTrigger { @@ -31,7 +31,6 @@ namespace RGB.NET.Core /// /// Initializes a new instance of the class. /// - /// A value indicating if the trigger should automatically right after construction. public ManualUpdateTrigger() { Start(); @@ -69,6 +68,9 @@ namespace RGB.NET.Core } } + /// + /// Triggers an update. + /// public void TriggerUpdate() => _mutex.Set(); private void UpdateLoop() diff --git a/RGB.NET.Core/Update/TimerUpdateTrigger.cs b/RGB.NET.Core/Update/TimerUpdateTrigger.cs index 5a7b7e3..98a7237 100644 --- a/RGB.NET.Core/Update/TimerUpdateTrigger.cs +++ b/RGB.NET.Core/Update/TimerUpdateTrigger.cs @@ -9,7 +9,7 @@ namespace RGB.NET.Core { /// /// - /// Represents an + /// Represents an update trigger that triggers in a set interval. /// public class TimerUpdateTrigger : AbstractUpdateTrigger { @@ -17,8 +17,19 @@ namespace RGB.NET.Core private readonly object _lock = new(); + /// + /// Gets or sets the update loop of this trigger. + /// protected Task? UpdateTask { get; set; } + + /// + /// Gets or sets the cancellation token source used to create the cancellation token checked by the . + /// protected CancellationTokenSource? UpdateTokenSource { get; set; } + + /// + /// Gets or sets the cancellation token checked by the . + /// protected CancellationToken UpdateToken { get; set; } private double _updateFrequency = 1.0 / 30.0; diff --git a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs index 68c545f..66e1ece 100644 --- a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs +++ b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs @@ -43,6 +43,7 @@ namespace RGB.NET.Devices.Asus #region Methods + /// protected override void InitializeSDK() { // ReSharper disable once SuspiciousTypeConversion.Global @@ -50,6 +51,7 @@ namespace RGB.NET.Devices.Asus _sdk.SwitchMode(); } + /// protected override IEnumerable LoadDevices() { if (_sdk == null) yield break; @@ -84,6 +86,8 @@ namespace RGB.NET.Devices.Asus _devices = null; _sdk = null; + + GC.SuppressFinalize(this); } #endregion diff --git a/RGB.NET.Devices.Asus/Enum/AsusLedId.cs b/RGB.NET.Devices.Asus/Enum/AsusLedId.cs index 5a9a118..d3fbf5d 100644 --- a/RGB.NET.Devices.Asus/Enum/AsusLedId.cs +++ b/RGB.NET.Devices.Asus/Enum/AsusLedId.cs @@ -1,4 +1,5 @@ // ReSharper disable InconsistentNaming +#pragma warning disable 1591 namespace RGB.NET.Devices.Asus { diff --git a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs index 24f427f..4b7ab36 100644 --- a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs +++ b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardLedMapping.cs @@ -2,6 +2,9 @@ namespace RGB.NET.Devices.Asus { + /// + /// Contains mappings for to . + /// public static class LedMappings { /// @@ -163,12 +166,14 @@ namespace RGB.NET.Devices.Asus /// /// A LED mapping containing extra lights for the ROG Zephyrus Duo 15 + /// + /// /// /// ASUS notebooks have extra lights under wide keys like space and backspace, these do not appear as keys on the device. /// Instead they only appear in the Lights enumerable, this mapping maps LED IDs to the index of these lights. /// /// You may add more of these by further populating . - /// + /// public static LedMapping ROGZephyrusDuo15 { get; } = new() { { LedId.Keyboard_Custom50, 39 }, // Mapping starts at Custom50 to avoid possible conflicts with KeyboardMapping above diff --git a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs index f2a02c9..9ac6f69 100644 --- a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs @@ -25,8 +25,8 @@ namespace RGB.NET.Devices.Asus #region Properties & Fields private readonly LedMapping? _ledMapping; - private Dictionary _ledAsusLed = new(); - private Dictionary _ledAsusLights = new(); + private readonly Dictionary _ledAsusLed = new(); + private readonly Dictionary _ledAsusLights = new(); IKeyboardDeviceInfo IKeyboard.DeviceInfo => DeviceInfo; @@ -34,11 +34,10 @@ namespace RGB.NET.Devices.Asus /// Gets or sets a list of extra LED mappings to apply to modes that match the provided regex /// Note: These LED mappings should be based on light indexes /// - public static List ExtraLedMappings = - new() - { - new AsusKeyboardExtraMapping(new Regex("(ROG Zephyrus Duo 15).*?"), LedMappings.ROGZephyrusDuo15) - }; + public static readonly List ExtraLedMappings = new() + { + new AsusKeyboardExtraMapping(new Regex("(ROG Zephyrus Duo 15).*?"), LedMappings.ROGZephyrusDuo15) + }; #endregion diff --git a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs index 3efe8eb..b695a69 100644 --- a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs +++ b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDeviceInfo.cs @@ -23,6 +23,7 @@ namespace RGB.NET.Devices.CoolerMaster /// public string Model { get; } + /// public object? LayoutMetadata { get; set; } /// diff --git a/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs b/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs index f67d587..f40ee2f 100644 --- a/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs +++ b/RGB.NET.Devices.CoolerMaster/Mouse/CoolerMasterMouseRGBDevice.cs @@ -10,12 +10,13 @@ namespace RGB.NET.Devices.CoolerMaster public class CoolerMasterMouseRGBDevice : CoolerMasterRGBDevice, IMouse { #region Constructors - + /// /// /// Initializes a new instance of the class. /// /// The specific information provided by CoolerMaster for the mouse + /// The update trigger used to update this device. internal CoolerMasterMouseRGBDevice(CoolerMasterMouseRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs b/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs index bb05b71..e0d367e 100644 --- a/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs +++ b/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterSDK.cs @@ -57,7 +57,7 @@ namespace RGB.NET.Devices.CoolerMaster.Native [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr LoadLibrary(string dllToLoad); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs index 5deab5c..588fa9d 100644 --- a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs @@ -21,6 +21,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the custom-device. + /// The queue used to update this device. internal CorsairCustomRGBDevice(CorsairCustomRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, new LedMapping(), updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs index d6e222d..c89423c 100644 --- a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs @@ -49,32 +49,21 @@ namespace RGB.NET.Devices.Corsair #region Methods private static RGBDeviceType GetDeviceType(CorsairChannelDeviceType deviceType) - { - switch (deviceType) + => deviceType switch { - case CorsairChannelDeviceType.Invalid: - return RGBDeviceType.Unknown; - - case CorsairChannelDeviceType.FanHD: - case CorsairChannelDeviceType.FanSP: - case CorsairChannelDeviceType.FanLL: - case CorsairChannelDeviceType.FanML: - case CorsairChannelDeviceType.DAP: - case CorsairChannelDeviceType.FanQL: - case CorsairChannelDeviceType.FanSPPRO: - return RGBDeviceType.Fan; - - case CorsairChannelDeviceType.Strip: - return RGBDeviceType.LedStripe; - - case CorsairChannelDeviceType.Pump: - case CorsairChannelDeviceType.WaterBlock: - return RGBDeviceType.Cooler; - - default: - throw new ArgumentOutOfRangeException(nameof(deviceType), deviceType, null); - } - } + CorsairChannelDeviceType.Invalid => RGBDeviceType.Unknown, + CorsairChannelDeviceType.FanHD => RGBDeviceType.Fan, + CorsairChannelDeviceType.FanSP => RGBDeviceType.Fan, + CorsairChannelDeviceType.FanLL => RGBDeviceType.Fan, + CorsairChannelDeviceType.FanML => RGBDeviceType.Fan, + CorsairChannelDeviceType.DAP => RGBDeviceType.Fan, + CorsairChannelDeviceType.FanQL => RGBDeviceType.Fan, + CorsairChannelDeviceType.FanSPPRO => RGBDeviceType.Fan, + CorsairChannelDeviceType.Strip => RGBDeviceType.LedStripe, + CorsairChannelDeviceType.Pump => RGBDeviceType.Cooler, + CorsairChannelDeviceType.WaterBlock => RGBDeviceType.Cooler, + _ => throw new ArgumentOutOfRangeException(nameof(deviceType), deviceType, null) + }; private static string GetModelName(string model, _CorsairChannelDeviceInfo channelDeviceInfo) { @@ -126,7 +115,9 @@ namespace RGB.NET.Devices.Corsair return "Pump"; default: - throw new ArgumentOutOfRangeException(nameof(channelDeviceInfo.type), channelDeviceInfo.type, null); +#pragma warning disable CA2208 // Instantiate argument exceptions correctly + throw new ArgumentOutOfRangeException($"{nameof(channelDeviceInfo)}.{nameof(channelDeviceInfo.type)}", channelDeviceInfo.type, null); +#pragma warning restore CA2208 // Instantiate argument exceptions correctly } } diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairAccessMode.cs b/RGB.NET.Devices.Corsair/Enum/CorsairAccessMode.cs index af8a87c..bf0adf7 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairAccessMode.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairAccessMode.cs @@ -6,7 +6,7 @@ namespace RGB.NET.Devices.Corsair { /// - /// Contains list of available SDK access modes. + /// Represents an SDK access mode. /// public enum CorsairAccessMode { diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs b/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs index 9b26176..5ac79a0 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs @@ -7,7 +7,7 @@ namespace RGB.NET.Devices.Corsair { /// - /// Contains list of available corsair channel device types. + /// Contains a list of available corsair channel device types. /// public enum CorsairChannelDeviceType { diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairDeviceCaps.cs b/RGB.NET.Devices.Corsair/Enum/CorsairDeviceCaps.cs index 4d49626..75b94f3 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairDeviceCaps.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairDeviceCaps.cs @@ -6,7 +6,7 @@ using System; namespace RGB.NET.Devices.Corsair { /// - /// Contains list of corsair device capabilities. + /// Contains a list of corsair device capabilities. /// [Flags] public enum CorsairDeviceCaps diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs b/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs index 52bb851..096fffc 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs @@ -7,7 +7,7 @@ namespace RGB.NET.Devices.Corsair { /// - /// Contains list of available corsair device types. + /// Contains a list of available corsair device types. /// public enum CorsairDeviceType { diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs b/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs index da23132..ea8040b 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairLedId.cs @@ -1,9 +1,11 @@ // ReSharper disable InconsistentNaming +// ReSharper disable UnusedMember.Global +#pragma warning disable 1591 namespace RGB.NET.Devices.Corsair { /// - /// Contains list of all LEDs available for all corsair devices. + /// Contains a list of all LEDs available for all corsair devices. /// public enum CorsairLedId { diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs b/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs index ce8ea57..5e5091b 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairLogicalKeyboardLayout.cs @@ -1,10 +1,11 @@ // ReSharper disable InconsistentNaming // ReSharper disable UnusedMember.Global +#pragma warning disable 1591 namespace RGB.NET.Devices.Corsair { /// - /// Contains list of available logical layouts for corsair keyboards. + /// Contains a list of available logical layouts for corsair keyboards. /// public enum CorsairLogicalKeyboardLayout { diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalKeyboardLayout.cs b/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalKeyboardLayout.cs index 0905b96..dc7d1b7 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalKeyboardLayout.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalKeyboardLayout.cs @@ -4,7 +4,7 @@ namespace RGB.NET.Devices.Corsair { /// - /// Contains list of available physical layouts for corsair keyboards. + /// Contains a list of available physical layouts for corsair keyboards. /// public enum CorsairPhysicalKeyboardLayout { diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalMouseLayout.cs b/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalMouseLayout.cs index e1fe9fb..cd45f6f 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalMouseLayout.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairPhysicalMouseLayout.cs @@ -1,7 +1,7 @@ namespace RGB.NET.Devices.Corsair { /// - /// Contains list of available physical layouts for mice. + /// Contains a list of available physical layouts for mice. /// public enum CorsairPhysicalMouseLayout { diff --git a/RGB.NET.Devices.Corsair/Generic/LedMappings.cs b/RGB.NET.Devices.Corsair/Generic/LedMappings.cs index 4547e12..b144bf8 100644 --- a/RGB.NET.Devices.Corsair/Generic/LedMappings.cs +++ b/RGB.NET.Devices.Corsair/Generic/LedMappings.cs @@ -2,6 +2,9 @@ namespace RGB.NET.Devices.Corsair { + /// + /// Contains mappings for to . + /// public static class LedMappings { static LedMappings() @@ -28,18 +31,43 @@ namespace RGB.NET.Devices.Corsair Keyboard.Add(LedId.Custom101 + i, CorsairLedId.OemLed101 + i); } + /// + /// Gets the mapping for graphics cards. + /// public static LedMapping GraphicsCard { get; } = new(); + + /// + /// Gets the mapping for headsets. + /// public static LedMapping HeadsetStand { get; } = new(); + + /// + /// Gets the mapping for mainboards. + /// public static LedMapping Mainboard { get; } = new(); + + /// + /// Gets the mapping for memory. + /// public static LedMapping Memory { get; } = new(); + + /// + /// Gets the mapping for mousepads. + /// public static LedMapping Mousepad { get; } = new(); + /// + /// Gets the mapping for headsets. + /// public static LedMapping Headset { get; } = new() { { LedId.Headset1, CorsairLedId.LeftLogo }, { LedId.Headset2, CorsairLedId.RightLogo }, }; + /// + /// Gets the mapping for mice. + /// public static LedMapping Mouse { get; } = new() { { LedId.Mouse1, CorsairLedId.B1 }, @@ -64,6 +92,9 @@ namespace RGB.NET.Devices.Corsair { LedId.Mouse20, CorsairLedId.B20 }, }; + /// + /// Gets the mapping for keyboards. + /// public static LedMapping Keyboard { get; } = new() { { LedId.Invalid, CorsairLedId.Invalid }, diff --git a/RGB.NET.Devices.Corsair/GraphicsCard/CorsairGraphicsCardRGBDevice.cs b/RGB.NET.Devices.Corsair/GraphicsCard/CorsairGraphicsCardRGBDevice.cs index e2f7205..76bd4e7 100644 --- a/RGB.NET.Devices.Corsair/GraphicsCard/CorsairGraphicsCardRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/GraphicsCard/CorsairGraphicsCardRGBDevice.cs @@ -18,6 +18,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the graphics card. + /// The queue used to update this device. internal CorsairGraphicsCardRGBDevice(CorsairGraphicsCardRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.GraphicsCard, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs b/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs index b1e1228..50c0a43 100644 --- a/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs @@ -18,6 +18,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the headset + /// The queue used to update this device. internal CorsairHeadsetRGBDevice(CorsairHeadsetRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.Headset, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/HeadsetStand/CorsairHeadsetStandRGBDevice.cs b/RGB.NET.Devices.Corsair/HeadsetStand/CorsairHeadsetStandRGBDevice.cs index e55ab93..4587da3 100644 --- a/RGB.NET.Devices.Corsair/HeadsetStand/CorsairHeadsetStandRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/HeadsetStand/CorsairHeadsetStandRGBDevice.cs @@ -18,6 +18,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the headset stand + /// The queue used to update this device. internal CorsairHeadsetStandRGBDevice(CorsairHeadsetStandRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.HeadsetStand, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs index 68eb450..b5f3144 100644 --- a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs @@ -24,6 +24,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the keyboard + /// The queue used to update this device. internal CorsairKeyboardRGBDevice(CorsairKeyboardRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.Keyboard, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Mainboard/CorsairMainboardRGBDevice.cs b/RGB.NET.Devices.Corsair/Mainboard/CorsairMainboardRGBDevice.cs index 9652bf0..14bedfc 100644 --- a/RGB.NET.Devices.Corsair/Mainboard/CorsairMainboardRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Mainboard/CorsairMainboardRGBDevice.cs @@ -18,6 +18,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the memory. + /// The queue used to update this device. internal CorsairMainboardRGBDevice(CorsairMainboardRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.Mainboard, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Memory/CorsairMemoryRGBDevice.cs b/RGB.NET.Devices.Corsair/Memory/CorsairMemoryRGBDevice.cs index 1f37d1c..3532312 100644 --- a/RGB.NET.Devices.Corsair/Memory/CorsairMemoryRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Memory/CorsairMemoryRGBDevice.cs @@ -18,6 +18,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the memory. + /// The queue used to update this device. internal CorsairMemoryRGBDevice(CorsairMemoryRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.Memory, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs b/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs index e69e22e..82c455f 100644 --- a/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs @@ -18,6 +18,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the mouse + /// The queue used to update this device. internal CorsairMouseRGBDevice(CorsairMouseRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.Mouse, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Mousepad/CorsairMousepadRGBDevice.cs b/RGB.NET.Devices.Corsair/Mousepad/CorsairMousepadRGBDevice.cs index d475a6f..7278271 100644 --- a/RGB.NET.Devices.Corsair/Mousepad/CorsairMousepadRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Mousepad/CorsairMousepadRGBDevice.cs @@ -18,6 +18,7 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the mousepad + /// The queue used to update this device. internal CorsairMousepadRGBDevice(CorsairMousepadRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.Mousepad, updateQueue) { } diff --git a/RGB.NET.Devices.Corsair/Native/_CUESDK.cs b/RGB.NET.Devices.Corsair/Native/_CUESDK.cs index 05483a5..b1dd6c8 100644 --- a/RGB.NET.Devices.Corsair/Native/_CUESDK.cs +++ b/RGB.NET.Devices.Corsair/Native/_CUESDK.cs @@ -68,7 +68,7 @@ namespace RGB.NET.Devices.Corsair.Native [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.DMX/DMXDeviceProvider.cs b/RGB.NET.Devices.DMX/DMXDeviceProvider.cs index 0d23fd5..cda8583 100644 --- a/RGB.NET.Devices.DMX/DMXDeviceProvider.cs +++ b/RGB.NET.Devices.DMX/DMXDeviceProvider.cs @@ -46,7 +46,7 @@ namespace RGB.NET.Devices.DMX #region Methods /// - /// Adds the given to this device-provider. + /// Adds the specified to this device-provider. /// /// The to add. public void AddDeviceDefinition(IDMXDeviceDefinition deviceDefinition) => DeviceDefinitions.Add(deviceDefinition); diff --git a/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs b/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs index 6697b2d..181e5a9 100644 --- a/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs +++ b/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs @@ -1,5 +1,8 @@ namespace RGB.NET.Devices.Logitech { + /// + /// Contains list of available logitech device types. + /// public enum LogitechDeviceType { Keyboard = 0x0, diff --git a/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs b/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs index 799ab70..3101371 100644 --- a/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs +++ b/RGB.NET.Devices.Logitech/Enum/LogitechLedId.cs @@ -1,4 +1,5 @@ // ReSharper disable InconsistentNaming +#pragma warning disable 1591 namespace RGB.NET.Devices.Logitech { diff --git a/RGB.NET.Devices.Logitech/Generic/LedMappings.cs b/RGB.NET.Devices.Logitech/Generic/LedMappings.cs index 679a4e3..dcc31f4 100644 --- a/RGB.NET.Devices.Logitech/Generic/LedMappings.cs +++ b/RGB.NET.Devices.Logitech/Generic/LedMappings.cs @@ -2,8 +2,14 @@ namespace RGB.NET.Devices.Logitech { + /// + /// Contains mappings for to . + /// public static class LedMappings { + /// + /// Gets the mapping for per key devices. + /// public static LedMapping PerKey { get; } = new() { { LedId.Keyboard_Escape, LogitechLedId.ESC }, @@ -131,11 +137,17 @@ namespace RGB.NET.Devices.Logitech { LedId.Keyboard_Custom1, LogitechLedId.G_BADGE }, }; + /// + /// Gets the mapping for per device devices. + /// public static LedMapping Device { get; } = new() { { LedId.Custom1, 0 } }; + /// + /// Gets the mapping for per zone keyboards. + /// public static LedMapping ZoneKeyboard { get; } = new() { { LedId.Keyboard_Programmable1, 0 }, @@ -172,6 +184,9 @@ namespace RGB.NET.Devices.Logitech { LedId.Keyboard_Programmable32, 31 }, }; + /// + /// Gets the mapping for per zone mice. + /// public static LedMapping ZoneMouse { get; } = new() { { LedId.Mouse1, 0 }, @@ -208,6 +223,9 @@ namespace RGB.NET.Devices.Logitech { LedId.Mouse32, 31 }, }; + /// + /// Gets the mapping for per zone headsets. + /// public static LedMapping ZoneHeadset { get; } = new() { { LedId.Headset1, 0 }, @@ -244,6 +262,9 @@ namespace RGB.NET.Devices.Logitech { LedId.Headset32, 31 }, }; + /// + /// Gets the mapping for per zone mousepads. + /// public static LedMapping ZoneMousepad { get; } = new() { { LedId.Mousepad1, 0 }, @@ -280,6 +301,9 @@ namespace RGB.NET.Devices.Logitech { LedId.Mousepad32, 31 }, }; + /// + /// Gets the mapping for per zone speakers. + /// public static LedMapping ZoneSpeaker { get; } = new() { { LedId.Speaker1, 0 }, diff --git a/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs b/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs index 1f34dab..f47efaf 100644 --- a/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs +++ b/RGB.NET.Devices.Logitech/Native/_LogitechGSDK.cs @@ -69,7 +69,7 @@ namespace RGB.NET.Devices.Logitech.Native [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.Msi/Native/_MsiSDK.cs b/RGB.NET.Devices.Msi/Native/_MsiSDK.cs index faa9dfe..fcc9fc3 100644 --- a/RGB.NET.Devices.Msi/Native/_MsiSDK.cs +++ b/RGB.NET.Devices.Msi/Native/_MsiSDK.cs @@ -75,7 +75,7 @@ namespace RGB.NET.Devices.Msi.Native [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs index 9c39612..aa040be 100644 --- a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs +++ b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs @@ -53,7 +53,7 @@ namespace RGB.NET.Devices.Novation /// - /// Creates a update-message out of a given data set. + /// Creates a update-message out of a specified data set. /// /// The data set to create the message from. /// The message created out of the data set. diff --git a/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs b/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs index ffa5d9c..94a267e 100644 --- a/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs +++ b/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs @@ -17,6 +17,7 @@ namespace RGB.NET.Devices.Novation /// Initializes a new instance of the class. /// /// The generic information provided by Novation for the device. + /// The update trigger used to update this device. protected NovationRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, GetUpdateQueue(updateTrigger, info)) { } diff --git a/RGB.NET.Devices.PicoPi/PicoPi/LedMappings.cs b/RGB.NET.Devices.PicoPi/PicoPi/LedMappings.cs index dd37db9..4ed85f6 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/LedMappings.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/LedMappings.cs @@ -2,10 +2,16 @@ namespace RGB.NET.Devices.PicoPi { + /// + /// Contains mappings for to the buffer-offset. + /// public static class LedMappings { #region Properties & Fields + /// + /// Gets the defautlt offset-mapping. + /// public static LedMapping StripeMapping = new(); #endregion diff --git a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs index f3a8248..c2ad416 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs @@ -13,7 +13,16 @@ namespace RGB.NET.Devices.PicoPi { #region Constants + /// + /// The vendor id used by the pico-pi firmware. + /// Registered at https://pid.codes/1209/2812/ + /// public const int VENDOR_ID = 0x1209; + + /// + /// The product id used by the pico-pi firmware. + /// Registered at https://pid.codes/1209/2812/ + /// public const int HID_BULK_CONTROLLER_PID = 0x2812; private const byte COMMAND_CHANNEL_COUNT = 0x01; diff --git a/RGB.NET.Devices.Razer/Generic/LedMappings.cs b/RGB.NET.Devices.Razer/Generic/LedMappings.cs index d136b54..cd9cbff 100644 --- a/RGB.NET.Devices.Razer/Generic/LedMappings.cs +++ b/RGB.NET.Devices.Razer/Generic/LedMappings.cs @@ -3,8 +3,14 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Contains mappings for to the matrix location. + /// public static class LedMappings { + /// + /// Gets the mapping for keyboards. + /// public static LedMapping Keyboard { get; } = new() { //Row 0 is empty @@ -154,6 +160,9 @@ namespace RGB.NET.Devices.Razer //Row 7 is also empty }; + /// + /// Gets the mapping for laptop keyboards. + /// public static LedMapping LaptopKeyboard { get; } = new() { //Row 0 is empty @@ -272,6 +281,9 @@ namespace RGB.NET.Devices.Razer //Row 7 is also empty }; + /// + /// Gets the mapping for mice. + /// public static LedMapping Mouse { get; } = new() { //row 0 empty @@ -316,12 +328,24 @@ namespace RGB.NET.Devices.Razer }; //TODO DarthAffe 27.04.2021: Are mappings for these possible? + /// + /// Gets the mapping for mousepads. + /// public static LedMapping Mousepad { get; } = new(); + /// + /// Gets the mapping for headsets. + /// public static LedMapping Headset { get; } = new(); + /// + /// Gets the mapping for keypads. + /// public static LedMapping Keypad { get; } = new(); + /// + /// Gets the mapping for chroma link devices. + /// public static LedMapping ChromaLink { get; } = new(); } } diff --git a/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs b/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs index 6a7208c..97ef2ea 100644 --- a/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs @@ -17,6 +17,7 @@ namespace RGB.NET.Devices.Razer /// Initializes a new instance of the class. /// /// The generic information provided by razer for the device. + /// The queue used to update this device. protected RazerRGBDevice(RazerRGBDeviceInfo info, IUpdateQueue updateQueue) : base(info, updateQueue) { diff --git a/RGB.NET.Devices.Razer/Native/_RazerSDK.cs b/RGB.NET.Devices.Razer/Native/_RazerSDK.cs index cd377e1..65c29d3 100644 --- a/RGB.NET.Devices.Razer/Native/_RazerSDK.cs +++ b/RGB.NET.Devices.Razer/Native/_RazerSDK.cs @@ -68,7 +68,7 @@ namespace RGB.NET.Devices.Razer.Native [DllImport("kernel32.dll")] private static extern bool FreeLibrary(IntPtr dllHandle); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + [DllImport("kernel32.dll", CharSet = CharSet.Ansi)] private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name); #endregion diff --git a/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs b/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs index 29a4035..9adcfdc 100644 --- a/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs +++ b/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesLedId.cs @@ -1,7 +1,11 @@ // ReSharper disable InconsistentNaming +#pragma warning disable 1591 namespace RGB.NET.Devices.SteelSeries { + /// + /// Contains a list of Steel Series LED IDs + /// public enum SteelSeriesLedId { [APIName("one")] diff --git a/RGB.NET.Devices.SteelSeries/Generic/LedMappings.cs b/RGB.NET.Devices.SteelSeries/Generic/LedMappings.cs index ec8d699..a1def31 100644 --- a/RGB.NET.Devices.SteelSeries/Generic/LedMappings.cs +++ b/RGB.NET.Devices.SteelSeries/Generic/LedMappings.cs @@ -2,8 +2,14 @@ namespace RGB.NET.Devices.SteelSeries { + /// + /// Contains mappings for to . + /// public static class LedMappings { + /// + /// Gets the uk-mapping for keyboards. + /// public static LedMapping KeyboardMappingUk { get; } = new() { { LedId.Logo, SteelSeriesLedId.Logo }, @@ -114,6 +120,9 @@ namespace RGB.NET.Devices.SteelSeries { LedId.Keyboard_NumPeriodAndDelete, SteelSeriesLedId.KeypadPeriod } }; + /// + /// Gets the uk-tkl-mapping for keyboards. + /// public static LedMapping KeyboardTklMappingUk { get; } = new() { { LedId.Logo, SteelSeriesLedId.Logo }, @@ -207,17 +216,26 @@ namespace RGB.NET.Devices.SteelSeries { LedId.Keyboard_ArrowRight, SteelSeriesLedId.RightArrow } }; + /// + /// Gets the mapping for one-zone mice. + /// public static LedMapping MouseOneZone { get; } = new() { { LedId.Mouse1, SteelSeriesLedId.ZoneOne } }; + /// + /// Gets the mapping for two-zone mice. + /// public static LedMapping MouseTwoZone { get; } = new() { { LedId.Mouse1, SteelSeriesLedId.ZoneOne }, { LedId.Mouse2, SteelSeriesLedId.ZoneTwo } }; + /// + /// Gets the mapping for three-zone mice. + /// public static LedMapping MouseThreeZone { get; } = new() { { LedId.Mouse1, SteelSeriesLedId.ZoneOne }, @@ -225,6 +243,9 @@ namespace RGB.NET.Devices.SteelSeries { LedId.Mouse3, SteelSeriesLedId.ZoneThree } }; + /// + /// Gets the mapping for eight-zone mice. + /// public static LedMapping MouseEightZone { get; } = new() { { LedId.Mouse1, SteelSeriesLedId.ZoneOne }, @@ -237,12 +258,18 @@ namespace RGB.NET.Devices.SteelSeries { LedId.Mouse8, SteelSeriesLedId.ZoneEight } }; + /// + /// Gets the mapping for two-zone headsets. + /// public static LedMapping HeadsetTwoZone { get; } = new() { { LedId.Headset1, SteelSeriesLedId.ZoneOne }, { LedId.Headset2, SteelSeriesLedId.ZoneTwo } }; + /// + /// Gets the mapping for twelve-zone mousepads + /// public static LedMapping MousepadTwelveZone { get; } = new() { { LedId.Mousepad1, SteelSeriesLedId.ZoneOne }, @@ -259,6 +286,9 @@ namespace RGB.NET.Devices.SteelSeries { LedId.Mousepad12, SteelSeriesLedId.ZoneTwelve }, }; + /// + /// Gets the mapping for 103-zone led strip devices (monitor). + /// public static LedMapping MonitorOnehundredandthreeZone { get; } = new() { { LedId.LedStripe1, SteelSeriesLedId.ZoneOne }, diff --git a/RGB.NET.Devices.WS281X/WS281XDeviceProvider.cs b/RGB.NET.Devices.WS281X/WS281XDeviceProvider.cs index deac3ae..a4d8c67 100644 --- a/RGB.NET.Devices.WS281X/WS281XDeviceProvider.cs +++ b/RGB.NET.Devices.WS281X/WS281XDeviceProvider.cs @@ -11,6 +11,7 @@ namespace RGB.NET.Devices.WS281X /// Represents a device provider responsible for WS2812B- and WS2811-Led-devices. /// // ReSharper disable once InconsistentNaming + // ReSharper disable once UnusedType.Global public class WS281XDeviceProvider : AbstractRGBDeviceProvider { #region Properties & Fields @@ -47,14 +48,16 @@ namespace RGB.NET.Devices.WS281X #region Methods /// - /// Adds the given to this device-provider. + /// Adds the specified to this device-provider. /// /// The to add. // ReSharper disable once UnusedMember.Global public void AddDeviceDefinition(IWS281XDeviceDefinition deviceDefinition) => DeviceDefinitions.Add(deviceDefinition); + /// protected override void InitializeSDK() { } + /// protected override IEnumerable LoadDevices() { int i = 0; diff --git a/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs b/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs index 473ff2e..6b25a54 100644 --- a/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs +++ b/RGB.NET.Devices.Wooting/Enum/WootingDeviceType.cs @@ -2,6 +2,9 @@ namespace RGB.NET.Devices.Wooting.Enum { + /// + /// Represents the type of a wooting device + /// public enum WootingDeviceType { /// 10 Keyless Keyboard. E.g. Wooting One diff --git a/RGB.NET.HID/HIDLoader.cs b/RGB.NET.HID/HIDLoader.cs index f4a7389..a8cee36 100644 --- a/RGB.NET.HID/HIDLoader.cs +++ b/RGB.NET.HID/HIDLoader.cs @@ -7,8 +7,18 @@ using RGB.NET.Core; namespace RGB.NET.HID { + /// + /// Represents the data used to define a HID-device. + /// + /// The type of the identifier leds are mapped to. + /// The type of the custom data added to the HID-device. public record HIDDeviceDefinition(int ProductId, RGBDeviceType DeviceType, string Name, LedMapping LedMapping, TData CustomData) where TLed : notnull; + /// + /// Represents a loaded for HID-devices based on the specified definitions. + /// + /// The type of the identifier leds are mapped to. + /// The type of the custom data added to the HID-device. public class HIDLoader : IEnumerable> where TLed : notnull { @@ -16,14 +26,24 @@ namespace RGB.NET.HID private readonly Dictionary> _deviceDefinitions = new(); + /// + /// Gets the vendor id used for this loader. + /// public int VendorId { get; } + /// + /// Gets or sets the filter used to determine which devices should be loaded. + /// public RGBDeviceType LoadFilter { get; set; } = RGBDeviceType.All; #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The vendor id used for this loader. public HIDLoader(int vendorId) { this.VendorId = vendorId; @@ -33,9 +53,21 @@ namespace RGB.NET.HID #region Methods + /// + /// Adds a new to this loader. + /// + /// The product id of the HID-device. + /// The type of the device. + /// The name of the device. + /// The mapping of the leds of the device. + /// Some custom data to attach to the device. public void Add(int productId, RGBDeviceType deviceType, string name, LedMapping ledMapping, TData customData) => _deviceDefinitions.Add(productId, new HIDDeviceDefinition(productId, deviceType, name, ledMapping, customData)); + /// + /// Gets a enumerable containing all devices from the definition-list that are connected and match the . + /// + /// The enumerable containing the connected devices. public IEnumerable<(HIDDeviceDefinition definition, HidDevice device)> GetConnectedDevices() { IEnumerable devices = DeviceList.Local.GetHidDevices(VendorId); @@ -47,11 +79,20 @@ namespace RGB.NET.HID } } + /// + /// Gets a enumerable containing all the first device of each group of devices from the definition-list that are connected and match the . + /// The grouping is done by the specified function. + /// + /// The type of the key used to group the devices. + /// The function grouping the devices. + /// The enumerable containing the selected devices. public IEnumerable<(HIDDeviceDefinition definition, HidDevice device)> GetConnectedDevices(Func, TKey> groupBy) => GetConnectedDevices().GroupBy(x => groupBy(x.definition)) .Select(group => group.First()); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + /// public IEnumerator> GetEnumerator() => _deviceDefinitions.Values.GetEnumerator(); #endregion diff --git a/RGB.NET.Layout/DeviceLayout.cs b/RGB.NET.Layout/DeviceLayout.cs index 77049e9..6aaccee 100644 --- a/RGB.NET.Layout/DeviceLayout.cs +++ b/RGB.NET.Layout/DeviceLayout.cs @@ -87,6 +87,10 @@ namespace RGB.NET.Layout [DefaultValue(19.0)] public float LedUnitHeight { get; set; } = 19.0f; + /// + /// Gets or sets the internal list of led layouts. + /// Normally you should use to access this data. + /// [XmlArray("Leds")] public List InternalLeds { get; set; } = new(); @@ -96,9 +100,14 @@ namespace RGB.NET.Layout [XmlIgnore] public IEnumerable Leds => InternalLeds; + /// + /// Gets or sets the internal custom data of this layout. + /// Normally you should use to access or set this data. + /// [XmlElement("CustomData")] public object? InternalCustomData { get; set; } + /// [XmlIgnore] public object? CustomData { get; set; } @@ -107,9 +116,11 @@ namespace RGB.NET.Layout #region Methods /// - /// Creates a new from the given xml. + /// Creates a new from the specified xml. /// /// The path to the xml file. + /// The type of the custom data. + /// The type of the custom data of the leds. /// The deserialized . public static DeviceLayout? Load(string path, Type? customDeviceDataType = null, Type? customLedDataType = null) { @@ -144,6 +155,12 @@ namespace RGB.NET.Layout } } + /// + /// Gets the deserialized custom data. + /// + /// The internal custom data node. + /// The type of the custom data. + /// The deserialized custom data object. protected virtual object? GetCustomData(object? customData, Type? type) { XmlNode? node = (customData as XmlNode) ?? (customData as IEnumerable)?.FirstOrDefault()?.ParentNode; //HACK DarthAffe 16.01.2021: This gives us the CustomData-Node diff --git a/RGB.NET.Layout/IDeviceLayout.cs b/RGB.NET.Layout/IDeviceLayout.cs index 2879200..aa05b7c 100644 --- a/RGB.NET.Layout/IDeviceLayout.cs +++ b/RGB.NET.Layout/IDeviceLayout.cs @@ -3,6 +3,9 @@ using RGB.NET.Core; namespace RGB.NET.Layout { + /// + /// Represents a generic layout of a device. + /// public interface IDeviceLayout { /// @@ -55,6 +58,9 @@ namespace RGB.NET.Layout /// IEnumerable Leds { get; } + /// + /// Gets the the custom data associated with the device. + /// object? CustomData { get; } } } diff --git a/RGB.NET.Layout/ILedLayout.cs b/RGB.NET.Layout/ILedLayout.cs index 5569692..9725166 100644 --- a/RGB.NET.Layout/ILedLayout.cs +++ b/RGB.NET.Layout/ILedLayout.cs @@ -2,6 +2,9 @@ namespace RGB.NET.Layout { + /// + /// Represents a generic layour of a LED. + /// public interface ILedLayout { /// @@ -39,6 +42,9 @@ namespace RGB.NET.Layout /// float Height { get; } + /// + /// Gets the the custom data associated with the LED. + /// object? CustomData { get; } } } diff --git a/RGB.NET.Layout/LayoutExtension.cs b/RGB.NET.Layout/LayoutExtension.cs index ec88f27..e917c42 100644 --- a/RGB.NET.Layout/LayoutExtension.cs +++ b/RGB.NET.Layout/LayoutExtension.cs @@ -5,8 +5,18 @@ using RGB.NET.Core; namespace RGB.NET.Layout { + /// + /// Offers some extensions and helper-methods for layout related things. + /// public static class LayoutExtension { + /// + /// Applies the specified layout to the specified device. + /// + /// The layout to apply. + /// The device to apply the layout to. + /// Indicates if LEDs that are in the layout but not on the device should be created. + /// Indicates if LEDS that are on the device but not in the layout should be removed. public static void ApplyTo(this IDeviceLayout layout, IRGBDevice device, bool createMissingLeds = false, bool removeExcessiveLeds = false) { device.Size = new Size(layout.Width, layout.Height); diff --git a/RGB.NET.Layout/LedLayout.cs b/RGB.NET.Layout/LedLayout.cs index 39af645..75d5fad 100644 --- a/RGB.NET.Layout/LedLayout.cs +++ b/RGB.NET.Layout/LedLayout.cs @@ -61,9 +61,14 @@ namespace RGB.NET.Layout [DefaultValue("1.0")] public string DescriptiveHeight { get; set; } = "1.0"; + /// + /// Gets or sets the internal custom data of this layout. + /// Normally you should use to access or set this data. + /// [XmlElement("CustomData")] public object? InternalCustomData { get; set; } + /// [XmlIgnore] public object? CustomData { get; set; } @@ -128,6 +133,14 @@ namespace RGB.NET.Layout Y = GetLocationValue(DescriptiveY, lastLed?.Y ?? 0, Height, lastLed?.Height ?? 0); } + /// + /// Gets the calculated location-value from the internal representation. + /// + /// The value provided by the layout. + /// The location of the last calculated LED. + /// The size of the current LED. + /// The size of the last loaded LED. + /// The location-value of the LED. protected virtual float GetLocationValue(string value, float lastValue, float currentSize, float lastSize) { try @@ -165,6 +178,12 @@ namespace RGB.NET.Layout } } + /// + /// Gets the calculated size-value from the internal representation. + /// + /// The value provided by the layout. + /// The absolute size of one 'unit'. + /// The size-value of the LED. protected virtual float GetSizeValue(string value, float unitSize) { try diff --git a/RGB.NET.Presets/Decorators/FlashDecorator.cs b/RGB.NET.Presets/Decorators/FlashDecorator.cs index 696782a..fd46c23 100644 --- a/RGB.NET.Presets/Decorators/FlashDecorator.cs +++ b/RGB.NET.Presets/Decorators/FlashDecorator.cs @@ -76,6 +76,11 @@ namespace RGB.NET.Presets.Decorators #region Constructors + /// + /// Creates a new from the specified xml. + /// + /// The surface this decorator belongs to. + /// A value indicating if the decorator should be updated if it is disabled. public FlashDecorator(RGBSurface surface, bool updateIfDisabled = false) : base(surface, updateIfDisabled) { } diff --git a/RGB.NET.Presets/Decorators/MoveGradientDecorator.cs b/RGB.NET.Presets/Decorators/MoveGradientDecorator.cs index 5f2280f..7233ec4 100644 --- a/RGB.NET.Presets/Decorators/MoveGradientDecorator.cs +++ b/RGB.NET.Presets/Decorators/MoveGradientDecorator.cs @@ -38,6 +38,7 @@ namespace RGB.NET.Presets.Decorators /// /// Initializes a new instance of the class. /// + /// The surface this decorator belongs to. /// The speed of the movement in units per second. /// The meaning of units differs for the different but 360 units will always be one complete cycle: /// : 360 unit = 1 offset. diff --git a/RGB.NET.Presets/Groups/RectangleLedGroup.cs b/RGB.NET.Presets/Groups/RectangleLedGroup.cs index a17ff98..c650322 100644 --- a/RGB.NET.Presets/Groups/RectangleLedGroup.cs +++ b/RGB.NET.Presets/Groups/RectangleLedGroup.cs @@ -54,10 +54,10 @@ namespace RGB.NET.Presets.Groups /// /// Initializes a new instance of the class. /// + /// Specifies the surface to attach this group to or null if the group should not be attached on creation. /// They first to calculate the of this from. /// They second to calculate the of this from. /// (optional) The minimal percentage overlay a must have with the to be taken into the . (default: 0.5) - /// (optional) Specifies whether this should be automatically attached or not. (default: true) public RectangleLedGroup(RGBSurface? surface, Led fromLed, Led toLed, double minOverlayPercentage = 0.5) : this(surface, new Rectangle(fromLed.Boundary, toLed.Boundary), minOverlayPercentage) { } @@ -66,10 +66,10 @@ namespace RGB.NET.Presets.Groups /// /// Initializes a new instance of the class. /// + /// Specifies the surface to attach this group to or null if the group should not be attached on creation. /// They first point to calculate the of this from. /// They second point to calculate the of this from. /// (optional) The minimal percentage overlay a must have with the to be taken into the . (default: 0.5) - /// (optional) Specifies whether this should be automatically attached or not. (default: true) public RectangleLedGroup(RGBSurface? surface, Point fromPoint, Point toPoint, double minOverlayPercentage = 0.5) : this(surface, new Rectangle(fromPoint, toPoint), minOverlayPercentage) { } @@ -78,9 +78,9 @@ namespace RGB.NET.Presets.Groups /// /// Initializes a new instance of the class. /// + /// Specifies the surface to attach this group to or null if the group should not be attached on creation. /// The of this . /// (optional) The minimal percentage overlay a must have with the to be taken into the . (default: 0.5) - /// (optional) Specifies whether this should be automatically attached or not. (default: true) public RectangleLedGroup(RGBSurface? surface, Rectangle rectangle, double minOverlayPercentage = 0.5) : base(surface) { diff --git a/RGB.NET.Presets/Helper/GradientHelper.cs b/RGB.NET.Presets/Helper/GradientHelper.cs index 6254fe5..88bba71 100644 --- a/RGB.NET.Presets/Helper/GradientHelper.cs +++ b/RGB.NET.Presets/Helper/GradientHelper.cs @@ -14,7 +14,7 @@ namespace RGB.NET.Presets.Helper // Based on https://web.archive.org/web/20170125201230/https://dotupdate.wordpress.com/2008/01/28/find-the-color-of-a-point-in-a-lineargradientbrush/ /// - /// Calculates the offset of an given on an gradient. + /// Calculates the offset of an specified on an gradient. /// /// The start of the gradient. /// The end of the gradient. diff --git a/RGB.NET.Presets/Textures/AbstractGradientTexture.cs b/RGB.NET.Presets/Textures/AbstractGradientTexture.cs index a724871..44fb53e 100644 --- a/RGB.NET.Presets/Textures/AbstractGradientTexture.cs +++ b/RGB.NET.Presets/Textures/AbstractGradientTexture.cs @@ -3,12 +3,17 @@ using RGB.NET.Presets.Textures.Gradients; namespace RGB.NET.Presets.Textures { + /// + /// + /// + /// Represents a abstract texture containing a color-gradient. + /// public abstract class AbstractGradientTexture : AbstractBindable, ITexture { #region Properties & Fields /// - /// Gets the gradient drawn by the brush. + /// Gets the gradient used to generate this texture. /// public IGradient Gradient { get; } @@ -25,6 +30,11 @@ namespace RGB.NET.Presets.Textures #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The size of the texture. + /// The gradient used to generate this texture. protected AbstractGradientTexture(Size size, IGradient gradient) { this.Size = size; @@ -35,6 +45,11 @@ namespace RGB.NET.Presets.Textures #region Methods + /// + /// Gets the color at the specified location of the texture. + /// + /// The location to get the color from. + /// The color at the specified location. protected abstract Color GetColor(in Point point); #endregion diff --git a/RGB.NET.Presets/Textures/BytePixelTexture.cs b/RGB.NET.Presets/Textures/BytePixelTexture.cs index ab008b7..9f1fd85 100644 --- a/RGB.NET.Presets/Textures/BytePixelTexture.cs +++ b/RGB.NET.Presets/Textures/BytePixelTexture.cs @@ -4,42 +4,69 @@ using RGB.NET.Presets.Textures.Sampler; namespace RGB.NET.Presets.Textures { + /// + /// + /// Represents a texture of byte-data pixels. + /// public sealed class BytePixelTexture : PixelTexture { #region Properties & Fields private readonly byte[] _data; + /// protected override ReadOnlySpan Data => _data; + /// + /// Gets the color format the data is in. + /// public ColorFormat ColorFormat { get; } #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// A is used. + /// + /// The width of the texture. + /// The height of the texture. + /// The pixel-data of the texture. + /// The color format the data is in. (default: RGB) public BytePixelTexture(int with, int height, byte[] data, ColorFormat colorFormat = ColorFormat.RGB) : this(with, height, data, new AverageByteSampler(), colorFormat) { } + /// + /// Initializes a new instance of the class. + /// + /// The width of the texture. + /// The height of the texture. + /// The pixel-data of the texture. + /// The sampler used to get the color of a region. + /// The color format the data is in. (default: RGB) public BytePixelTexture(int with, int height, byte[] data, ISampler sampler, ColorFormat colorFormat = ColorFormat.RGB) : base(with, height, 3, sampler) { this._data = data; this.ColorFormat = colorFormat; - if (Data.Length != ((with * height) * 3)) throw new ArgumentException($"Data-Length {Data.Length} differs from the given size {with}x{height} * 3 bytes ({with * height * 3})."); + if (Data.Length != ((with * height) * 3)) throw new ArgumentException($"Data-Length {Data.Length} differs from the specified size {with}x{height} * 3 bytes ({with * height * 3})."); } #endregion #region Methods + /// protected override Color GetColor(in ReadOnlySpan pixel) { - if (ColorFormat == ColorFormat.BGR) - return new Color(pixel[2], pixel[1], pixel[0]); - - return new Color(pixel[0], pixel[1], pixel[2]); + return ColorFormat switch + { + ColorFormat.RGB => new Color(pixel[0], pixel[1], pixel[2]), + ColorFormat.BGR => new Color(pixel[2], pixel[1], pixel[0]), + _ => throw new ArgumentOutOfRangeException() + }; } #endregion diff --git a/RGB.NET.Presets/Textures/ConicalGradientTexture.cs b/RGB.NET.Presets/Textures/ConicalGradientTexture.cs index cf53ae4..60066fc 100644 --- a/RGB.NET.Presets/Textures/ConicalGradientTexture.cs +++ b/RGB.NET.Presets/Textures/ConicalGradientTexture.cs @@ -12,7 +12,7 @@ namespace RGB.NET.Presets.Textures { /// /// - /// Represents a brush drawing a conical gradient. + /// Represents a texture drawing a conical gradient. /// public sealed class ConicalGradientTexture : AbstractGradientTexture { @@ -51,6 +51,7 @@ namespace RGB.NET.Presets.Textures /// /// Initializes a new instance of the class. /// + /// The size of the texture. /// The drawn by this . public ConicalGradientTexture(Size size, IGradient gradient) : base(size, gradient) @@ -59,8 +60,9 @@ namespace RGB.NET.Presets.Textures /// /// Initializes a new instance of the class. /// - /// The center (as percentage in the range [0..1]). + /// The size of the texture. /// The drawn by this . + /// The center (as percentage in the range [0..1]). public ConicalGradientTexture(Size size, IGradient gradient, Point center) : base(size, gradient) { @@ -70,9 +72,10 @@ namespace RGB.NET.Presets.Textures /// /// Initializes a new instance of the class. /// - /// The center (as percentage in the range [0..1]). - /// The origin (radian-angle) the is drawn to. + /// The size of the texture. /// The drawn by this . + /// The center (as percentage in the range [0..1]). + /// The origin (radian-angle) the gradient is drawn to. public ConicalGradientTexture(Size size, IGradient gradient, Point center, float origin) : base(size, gradient) { @@ -84,6 +87,7 @@ namespace RGB.NET.Presets.Textures #region Methods + /// protected override Color GetColor(in Point point) { float angle = MathF.Atan2(point.Y - Center.Y, point.X - Center.X) - Origin; diff --git a/RGB.NET.Presets/Textures/Enums/ColorFormat.cs b/RGB.NET.Presets/Textures/Enums/ColorFormat.cs index a098ff5..d190501 100644 --- a/RGB.NET.Presets/Textures/Enums/ColorFormat.cs +++ b/RGB.NET.Presets/Textures/Enums/ColorFormat.cs @@ -1,5 +1,10 @@ -namespace RGB.NET.Presets.Textures +#pragma warning disable 1591 + +namespace RGB.NET.Presets.Textures { + /// + /// Contains a list of possible color formats. + /// public enum ColorFormat { RGB, diff --git a/RGB.NET.Presets/Textures/FloatPixelTexture.cs b/RGB.NET.Presets/Textures/FloatPixelTexture.cs index 686f05c..1eb3e08 100644 --- a/RGB.NET.Presets/Textures/FloatPixelTexture.cs +++ b/RGB.NET.Presets/Textures/FloatPixelTexture.cs @@ -4,42 +4,69 @@ using RGB.NET.Presets.Textures.Sampler; namespace RGB.NET.Presets.Textures { + /// + /// + /// Represents a texture of float-data pixels. + /// public sealed class FloatPixelTexture : PixelTexture { #region Properties & Fields private readonly float[] _data; + /// protected override ReadOnlySpan Data => _data; + /// + /// Gets the color format the data is in. + /// public ColorFormat ColorFormat { get; } #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// A is used. + /// + /// The width of the texture. + /// The height of the texture. + /// The pixel-data of the texture. + /// The color format the data is in. (default: RGB) public FloatPixelTexture(int with, int height, float[] data, ColorFormat colorFormat = ColorFormat.RGB) : this(with, height, data, new AverageFloatSampler(), colorFormat) { } + /// + /// Initializes a new instance of the class. + /// + /// The width of the texture. + /// The height of the texture. + /// The pixel-data of the texture. + /// The sampler used to get the color of a region. + /// The color format the data is in. (default: RGB) public FloatPixelTexture(int with, int height, float[] data, ISampler sampler, ColorFormat colorFormat = ColorFormat.RGB) : base(with, height, 3, sampler) { this._data = data; this.ColorFormat = colorFormat; - if (Data.Length != ((with * height) * 3)) throw new ArgumentException($"Data-Length {Data.Length} differs from the given size {with}x{height} * 3 bytes ({with * height * 3})."); + if (Data.Length != ((with * height) * 3)) throw new ArgumentException($"Data-Length {Data.Length} differs from the specified size {with}x{height} * 3 bytes ({with * height * 3})."); } #endregion #region Methods + /// protected override Color GetColor(in ReadOnlySpan pixel) { - if (ColorFormat == ColorFormat.BGR) - return new Color(pixel[2], pixel[1], pixel[0]); - - return new Color(pixel[0], pixel[1], pixel[2]); + return ColorFormat switch + { + ColorFormat.RGB => new Color(pixel[0], pixel[1], pixel[2]), + ColorFormat.BGR => new Color(pixel[2], pixel[1], pixel[0]), + _ => throw new ArgumentOutOfRangeException() + }; } #endregion diff --git a/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs b/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs index 2aa898e..9c27d08 100644 --- a/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs +++ b/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs @@ -79,7 +79,7 @@ namespace RGB.NET.Presets.Textures.Gradients /// /// - /// Gets the linear interpolated at the given offset. + /// Gets the linear interpolated at the specified offset. /// /// The percentage offset to take the color from. /// The at the specific offset. @@ -106,7 +106,7 @@ namespace RGB.NET.Presets.Textures.Gradients } /// - /// Get the two s encapsulating the given offset. + /// Get the two s encapsulating the specified offset. /// /// The reference offset. /// The ordered list of to choose from. diff --git a/RGB.NET.Presets/Textures/Gradients/RainbowGradient.cs b/RGB.NET.Presets/Textures/Gradients/RainbowGradient.cs index 1ec32e2..470c877 100644 --- a/RGB.NET.Presets/Textures/Gradients/RainbowGradient.cs +++ b/RGB.NET.Presets/Textures/Gradients/RainbowGradient.cs @@ -67,7 +67,7 @@ namespace RGB.NET.Presets.Textures.Gradients /// /// - /// Gets the color on the rainbow at the given offset. + /// Gets the color on the rainbow at the specified offset. /// /// The percentage offset to take the color from. /// The color at the specific offset. diff --git a/RGB.NET.Presets/Textures/LinearGradientTexture.cs b/RGB.NET.Presets/Textures/LinearGradientTexture.cs index d37bf6a..f3173d3 100644 --- a/RGB.NET.Presets/Textures/LinearGradientTexture.cs +++ b/RGB.NET.Presets/Textures/LinearGradientTexture.cs @@ -13,7 +13,7 @@ namespace RGB.NET.Presets.Textures { /// /// - /// Represents a brush drawing a linear gradient. + /// Represents a texture drawing a linear gradient. /// public sealed class LinearGradientTexture : AbstractGradientTexture { @@ -46,6 +46,7 @@ namespace RGB.NET.Presets.Textures /// /// Initializes a new instance of the class. /// + /// The size of the texture. /// The drawn by this . public LinearGradientTexture(Size size, IGradient gradient) : base(size, gradient) @@ -54,9 +55,10 @@ namespace RGB.NET.Presets.Textures /// /// Initializes a new instance of the class. /// + /// The size of the texture. + /// The drawn by this . /// The start (as percentage in the range [0..1]). /// The end (as percentage in the range [0..1]). - /// The drawn by this . public LinearGradientTexture(Size size, IGradient gradient, Point startPoint, Point endPoint) : base(size, gradient) { @@ -68,6 +70,7 @@ namespace RGB.NET.Presets.Textures #region Methods + /// protected override Color GetColor(in Point point) { float offset = GradientHelper.CalculateLinearGradientOffset(StartPoint, EndPoint, point); diff --git a/RGB.NET.Presets/Textures/RadialGradientTexture.cs b/RGB.NET.Presets/Textures/RadialGradientTexture.cs index b5ff848..4f6f4ca 100644 --- a/RGB.NET.Presets/Textures/RadialGradientTexture.cs +++ b/RGB.NET.Presets/Textures/RadialGradientTexture.cs @@ -10,7 +10,7 @@ namespace RGB.NET.Presets.Textures { /// /// - /// Represents a brush drawing a radial gradient around a center point. + /// Represents a texture drawing a radial gradient around a center point. /// public sealed class RadialGradientTexture : AbstractGradientTexture { @@ -39,6 +39,7 @@ namespace RGB.NET.Presets.Textures /// /// Initializes a new instance of the class. /// + /// The size of the texture. /// The gradient drawn by the brush. public RadialGradientTexture(Size size, IGradient gradient) : base(size, gradient) @@ -47,8 +48,9 @@ namespace RGB.NET.Presets.Textures /// /// Initializes a new instance of the class. /// - /// The center point (as percentage in the range [0..1]). + /// The size of the texture. /// The gradient drawn by the brush. + /// The center point (as percentage in the range [0..1]). public RadialGradientTexture(Size size, IGradient gradient, Point center) : base(size, gradient) { @@ -66,6 +68,7 @@ namespace RGB.NET.Presets.Textures _referenceDistance = GradientHelper.CalculateDistance(new Point(referenceX, referenceY), Center); } + /// protected override Color GetColor(in Point point) { float distance = GradientHelper.CalculateDistance(point, Center); diff --git a/RGB.NET.Presets/Textures/Sampler/AverageByteSampler.cs b/RGB.NET.Presets/Textures/Sampler/AverageByteSampler.cs index b2f3770..dc94e5c 100644 --- a/RGB.NET.Presets/Textures/Sampler/AverageByteSampler.cs +++ b/RGB.NET.Presets/Textures/Sampler/AverageByteSampler.cs @@ -3,11 +3,15 @@ using RGB.NET.Core; namespace RGB.NET.Presets.Textures.Sampler { + /// + /// Represents a sampled that averages multiple byte-data entries. + /// public class AverageByteSampler : ISampler { #region Methods - public void SampleColor(in SamplerInfo info, in Span pixelData) + /// + public void Sample(in SamplerInfo info, in Span pixelData) { int count = info.Width * info.Height; if (count == 0) return; diff --git a/RGB.NET.Presets/Textures/Sampler/AverageFloatSampler.cs b/RGB.NET.Presets/Textures/Sampler/AverageFloatSampler.cs index 12b0368..902971f 100644 --- a/RGB.NET.Presets/Textures/Sampler/AverageFloatSampler.cs +++ b/RGB.NET.Presets/Textures/Sampler/AverageFloatSampler.cs @@ -3,11 +3,15 @@ using RGB.NET.Core; namespace RGB.NET.Presets.Textures.Sampler { + /// + /// Represents a sampled that averages multiple float-data entries. + /// public class AverageFloatSampler : ISampler { #region Methods - public void SampleColor(in SamplerInfo info, in Span pixelData) + /// + public void Sample(in SamplerInfo info, in Span pixelData) { int count = info.Width * info.Height; if (count == 0) return; diff --git a/Tests/RGB.NET.Core.Tests/Color/ColorTest.cs b/Tests/RGB.NET.Core.Tests/Color/ColorTest.cs index 4b22146..ed2e5d0 100644 --- a/Tests/RGB.NET.Core.Tests/Color/ColorTest.cs +++ b/Tests/RGB.NET.Core.Tests/Color/ColorTest.cs @@ -324,13 +324,16 @@ namespace RGB.NET.Core.Tests.Color Assert.AreEqual(1, color2.A); Core.Color color3 = new(128, 0, 0, 0); - Assert.AreEqual(128 / 255.0f, color3.A); + Assert.AreEqual(128 / 256.0f, color3.A); Core.Color color4 = new(30, 0, 0, 0); - Assert.AreEqual(30 / 255.0f, color4.A); + Assert.AreEqual(30 / 256.0f, color4.A); Core.Color color5 = new(201, 0, 0, 0); - Assert.AreEqual(201 / 255.0f, color5.A); + Assert.AreEqual(201 / 256.0f, color5.A); + + Core.Color color6 = new(255, 0, 0, 0); + Assert.AreEqual(1f, color6.A); } [TestMethod] @@ -343,13 +346,16 @@ namespace RGB.NET.Core.Tests.Color Assert.AreEqual(1, color2.R); Core.Color color3 = new(0, 128, 0, 0); - Assert.AreEqual(128 / 255.0f, color3.R); + Assert.AreEqual(128 / 256.0f, color3.R); Core.Color color4 = new(0, 30, 0, 0); - Assert.AreEqual(30 / 255.0f, color4.R); + Assert.AreEqual(30 / 256.0f, color4.R); Core.Color color5 = new(0, 201, 0, 0); - Assert.AreEqual(201 / 255.0f, color5.R); + Assert.AreEqual(201 / 256.0f, color5.R); + + Core.Color color6 = new(0, 255, 0, 0); + Assert.AreEqual(1f, color6.R); } [TestMethod] @@ -362,13 +368,16 @@ namespace RGB.NET.Core.Tests.Color Assert.AreEqual(1, color2.G); Core.Color color3 = new(0, 0, 128, 0); - Assert.AreEqual(128 / 255.0f, color3.G); + Assert.AreEqual(128 / 256.0f, color3.G); Core.Color color4 = new(0, 0, 30, 0); - Assert.AreEqual(30 / 255.0f, color4.G); + Assert.AreEqual(30 / 256.0f, color4.G); Core.Color color5 = new(0, 0, 201, 0); - Assert.AreEqual(201 / 255.0f, color5.G); + Assert.AreEqual(201 / 256.0f, color5.G); + + Core.Color color6 = new(0, 0, 255, 0); + Assert.AreEqual(1f, color6.G); } [TestMethod] @@ -381,13 +390,16 @@ namespace RGB.NET.Core.Tests.Color Assert.AreEqual(1, color2.B); Core.Color color3 = new(0, 0, 0, 128); - Assert.AreEqual(128 / 255.0f, color3.B); + Assert.AreEqual(128 / 256.0f, color3.B); Core.Color color4 = new(0, 0, 0, 30); - Assert.AreEqual(30 / 255.0f, color4.B); + Assert.AreEqual(30 / 256.0f, color4.B); Core.Color color5 = new(0, 0, 0, 201); - Assert.AreEqual(201 / 255.0f, color5.B); + Assert.AreEqual(201 / 256.0f, color5.B); + + Core.Color color6 = new(0, 0, 0, 255); + Assert.AreEqual(1f, color6.B); } #endregion From 7c0a216ccdca43148f9150874df6b788ce8a66f2 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 1 Aug 2021 16:40:13 +0200 Subject: [PATCH 4/6] Fixed code issues --- .../Dram/AsusDramRGBDevice.cs | 1 + RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs | 1 + .../Generic/AsusRGBDeviceInfo.cs | 4 ++ .../Generic/AsusUnspecifiedRGBDevice.cs | 2 + .../Generic/AsusUpdateQueue.cs | 1 + .../GraphicsCard/AsusGraphicsCardRGBDevice.cs | 1 + .../Headset/AsusHeadsetRGBDevice.cs | 1 + .../Keyboard/AsusKeyboardRGBDevice.cs | 7 ++- .../Mainboard/AsusMainboardRGBDevice.cs | 1 + .../Mouse/AsusMouseRGBDevice.cs | 1 + .../CoolerMasterDeviceProvider.cs | 2 + .../Generic/CoolerMasterRGBDevice.cs | 1 + .../Keyboard/CoolerMasterKeyboardRGBDevice.cs | 1 + .../CorsairDeviceProvider.cs | 2 + .../Custom/CorsairCustomRGBDeviceInfo.cs | 14 +++++- .../Generic/CorsairRGBDevice.cs | 10 +++- .../Keyboard/CorsairKeyboardRGBDevice.cs | 2 +- RGB.NET.Devices.DMX/DMXDeviceProvider.cs | 2 + RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs | 1 + RGB.NET.Devices.Debug/DebugDeviceProvider.cs | 2 + RGB.NET.Devices.Debug/DebugRGBDevice.cs | 3 ++ RGB.NET.Devices.Debug/DebugRGBDeviceInfo.cs | 2 + .../Enum/LogitechDeviceType.cs | 4 +- .../Generic/LogitechRGBDevice.cs | 1 + .../Generic/LogitechRGBDeviceInfo.cs | 3 +- .../LogitechDeviceProvider.cs | 15 +++++- RGB.NET.Devices.Msi/Generic/MsiRGBDevice.cs | 1 + .../GraphicsCard/MsiGraphicsCardRGBDevice.cs | 2 + .../Mainboard/MsiMainboardRGBDevice.cs | 2 + .../Mouse/MsiMouseRGBDevice.cs | 2 + RGB.NET.Devices.Msi/MsiDeviceProvider.cs | 2 + .../Generic/MidiUpdateQueue.cs | 4 +- .../Launchpad/NovationLaunchpadRGBDevice.cs | 8 ++- .../NovationLaunchpadRGBDeviceInfo.cs | 8 +-- .../NovationDeviceProvider.cs | 2 + RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs | 4 ++ .../PicoPi/PicoPiBulkUpdateQueue.cs | 15 ++++++ .../PicoPi/PicoPiHIDUpdateQueue.cs | 12 +++++ .../PicoPi/PicoPiRGBDevice.cs | 11 ++++ .../PicoPi/PicoPiRGBDeviceInfo.cs | 27 ++++++++++ RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs | 50 +++++++++++++++++++ .../PicoPiDeviceProvider.cs | 9 ++++ .../ChromaLink/RazerChromaLinkRGBDevice.cs | 1 + .../Headset/RazerHeadsetRGBDevice.cs | 1 + .../Keyboard/RazerKeyboardRGBDevice.cs | 2 + .../Keypad/RazerKeypadRGBDevice.cs | 1 + .../Mouse/RazerMouseRGBDevice.cs | 2 + .../Mousepad/RazerMousepadRGBDevice.cs | 1 + RGB.NET.Devices.Razer/RazerDeviceProvider.cs | 6 +++ .../Enum/SteelSeriesDeviceType.cs | 4 +- .../Generic/SteelSeriesRGBDeviceInfo.cs | 7 +-- .../SteelSeriesDeviceProvider.cs | 5 +- .../Arduino/ArduinoWS2812USBDevice.cs | 3 +- .../Arduino/ArduinoWS2812USBUpdateQueue.cs | 3 +- .../Bitwizard/BitwizardWS2812USBDevice.cs | 4 +- .../BitwizardWS2812USBUpdateQueue.cs | 3 +- .../BitwizardWS281XDeviceDefinition.cs | 5 ++ .../Generic/SerialPortConnection.cs | 5 ++ .../Generic/SerialPortUpdateQueue.cs | 3 +- .../NodeMCU/NodeMCUWS2812USBDevice.cs | 7 +-- .../Generic/WootingRGBDevice.cs | 1 + .../Keyboard/WootingKeyboardRGBDevice.cs | 1 + .../Keyboard/WootingKeyboardRGBDeviceInfo.cs | 1 - .../WootingDeviceProvider.cs | 2 + 64 files changed, 278 insertions(+), 34 deletions(-) diff --git a/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs b/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs index ef1b046..8b6cb75 100644 --- a/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the DRAM. + /// The update trigger used to update this device. internal AsusDramRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs b/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs index f80056a..e4ce12f 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The generic information provided by Asus for the device. + /// The update trigger used to update this device. protected AsusRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new AsusUpdateQueue(updateTrigger, info.Device)) { } diff --git a/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs b/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs index 1d1b1dd..edd9983 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs @@ -23,8 +23,12 @@ namespace RGB.NET.Devices.Asus /// public string Model { get; } + /// public object? LayoutMetadata { get; set; } + /// + /// Gets the SDK-aura-device this device represents. + /// public IAuraSyncDevice Device { get; } #endregion diff --git a/RGB.NET.Devices.Asus/Generic/AsusUnspecifiedRGBDevice.cs b/RGB.NET.Devices.Asus/Generic/AsusUnspecifiedRGBDevice.cs index e0abfa5..76a6a62 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusUnspecifiedRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusUnspecifiedRGBDevice.cs @@ -21,6 +21,8 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the headset. + /// The ledId of the first led of this device. All other leds are created by incrementing this base-id by 1. + /// The update trigger used to update this device. internal AsusUnspecifiedRGBDevice(AsusRGBDeviceInfo info, LedId baseLedId, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs b/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs index 77d4540..c4ce671 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs @@ -25,6 +25,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The update trigger used by this queue. + /// The SDK-aura-device this device represents. public AsusUpdateQueue(IDeviceUpdateTrigger updateTrigger, IAuraSyncDevice device) : base(updateTrigger) { diff --git a/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs b/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs index 698b2c3..5953240 100644 --- a/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs +++ b/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the graphics card. + /// The update trigger used to update this device. internal AsusGraphicsCardRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Asus/Headset/AsusHeadsetRGBDevice.cs b/RGB.NET.Devices.Asus/Headset/AsusHeadsetRGBDevice.cs index 22d14d9..936eef5 100644 --- a/RGB.NET.Devices.Asus/Headset/AsusHeadsetRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Headset/AsusHeadsetRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the headset. + /// The update trigger used to update this device. internal AsusHeadsetRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs index 9ac6f69..4b2ae42 100644 --- a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs @@ -31,9 +31,10 @@ namespace RGB.NET.Devices.Asus IKeyboardDeviceInfo IKeyboard.DeviceInfo => DeviceInfo; /// - /// Gets or sets a list of extra LED mappings to apply to modes that match the provided regex - /// Note: These LED mappings should be based on light indexes + /// Gets or sets a list of extra LED mappings to apply to modes that match the provided regex. + /// Note: These LED mappings should be based on light indexes. /// + // ReSharper disable once InconsistentNaming public static readonly List ExtraLedMappings = new() { new AsusKeyboardExtraMapping(new Regex("(ROG Zephyrus Duo 15).*?"), LedMappings.ROGZephyrusDuo15) @@ -48,6 +49,8 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the keyboard. + /// A mapping of leds this device is initialized with. + /// The update trigger used to update this device. internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info, LedMapping? ledMapping, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs b/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs index bde9f1b..f4ba9c4 100644 --- a/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the mainboard. + /// The update trigger used to update this device. internal AsusMainboardRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs b/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs index fdbd204..86dfe29 100644 --- a/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the mouse. + /// The update trigger used to update this device. internal AsusMouseRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs b/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs index f0fdcbf..4c60422 100644 --- a/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs +++ b/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs @@ -53,12 +53,14 @@ namespace RGB.NET.Devices.CoolerMaster #region Methods + /// protected override void InitializeSDK() { _CoolerMasterSDK.Reload(); if (_CoolerMasterSDK.GetSDKVersion() <= 0) Throw(new RGBDeviceException("Failed to initialize CoolerMaster-SDK"), true); } + /// protected override IEnumerable LoadDevices() { foreach (CoolerMasterDevicesIndexes index in Enum.GetValues(typeof(CoolerMasterDevicesIndexes))) diff --git a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs index fdeaf39..9dfaf6b 100644 --- a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs +++ b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs @@ -17,6 +17,7 @@ namespace RGB.NET.Devices.CoolerMaster /// Initializes a new instance of the class. /// /// The generic information provided by CoolerMaster for the device. + /// The update trigger used to update this device. protected CoolerMasterRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new CoolerMasterUpdateQueue(updateTrigger, info.DeviceIndex)) { } diff --git a/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs b/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs index 9007148..b1350a7 100644 --- a/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs @@ -22,6 +22,7 @@ namespace RGB.NET.Devices.CoolerMaster /// Initializes a new instance of the class. /// /// The specific information provided by CoolerMaster for the keyboard + /// The update trigger used to update this device. internal CoolerMasterKeyboardRGBDevice(CoolerMasterKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs index 33fcd75..9392be0 100644 --- a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs +++ b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs @@ -63,6 +63,7 @@ namespace RGB.NET.Devices.Corsair #region Methods + /// protected override void InitializeSDK() { _CUESDK.Reload(); @@ -193,6 +194,7 @@ namespace RGB.NET.Devices.Corsair }; } + /// protected override void Reset() { ProtocolDetails = null; diff --git a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs index c89423c..5216ebf 100644 --- a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs @@ -17,8 +17,19 @@ namespace RGB.NET.Devices.Corsair { #region Properties & Fields + /// + /// Gets the corsair-id of the first LED of this device. + /// public CorsairLedId ReferenceCorsairLed { get; } + + /// + /// Gets the amount of LEDs this device contains. + /// public int LedCount { get; } + + /// + /// Gets the offset used to access the LEDs of this device. + /// internal int LedOffset { get; } #endregion @@ -33,7 +44,8 @@ namespace RGB.NET.Devices.Corsair /// The index of the . /// The native -struct /// The native representing this device. - /// The id of the first led of this device. + /// The id of the first LED of this device. + /// The offset used to find the LEDs of this device. internal CorsairCustomRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo, _CorsairChannelDeviceInfo channelDeviceInfo, CorsairLedId referenceCorsairLed, int ledOffset) : base(deviceIndex, GetDeviceType(channelDeviceInfo.type), nativeInfo, GetModelName(nativeInfo.model == IntPtr.Zero ? string.Empty : Regex.Replace(Marshal.PtrToStringAnsi(nativeInfo.model) ?? string.Empty, " ?DEMO", string.Empty, RegexOptions.IgnoreCase), channelDeviceInfo)) diff --git a/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs b/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs index 22792fc..f192bbc 100644 --- a/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs @@ -14,6 +14,9 @@ namespace RGB.NET.Devices.Corsair { #region Properties & Fields + /// + /// Gets the mapping of to used to update the LEDs of this device. + /// protected LedMapping Mapping { get; } #endregion @@ -24,6 +27,8 @@ namespace RGB.NET.Devices.Corsair /// Initializes a new instance of the class. /// /// The generic information provided by CUE for the device. + /// The mapping to used to update the LEDs of this device. + /// The queue used to update this device. protected CorsairRGBDevice(TDeviceInfo info, LedMapping mapping, CorsairDeviceUpdateQueue updateQueue) : base(info, updateQueue) { @@ -35,7 +40,10 @@ namespace RGB.NET.Devices.Corsair #region Methods void ICorsairRGBDevice.Initialize() => InitializeLayout(); - + + /// + /// Initializes the LEDs of the device based on the data provided by the SDK. + /// protected virtual void InitializeLayout() { _CorsairLedPositions? nativeLedPositions = (_CorsairLedPositions?)Marshal.PtrToStructure(_CUESDK.CorsairGetLedPositionsByDeviceIndex(DeviceInfo.CorsairDeviceIndex), typeof(_CorsairLedPositions)); diff --git a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs index b5f3144..a82c1b1 100644 --- a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs @@ -23,7 +23,7 @@ namespace RGB.NET.Devices.Corsair /// /// Initializes a new instance of the class. /// - /// The specific information provided by CUE for the keyboard + /// The specific information provided by CUE for the keyboard. /// The queue used to update this device. internal CorsairKeyboardRGBDevice(CorsairKeyboardRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) : base(info, LedMappings.Keyboard, updateQueue) diff --git a/RGB.NET.Devices.DMX/DMXDeviceProvider.cs b/RGB.NET.Devices.DMX/DMXDeviceProvider.cs index cda8583..05c8afb 100644 --- a/RGB.NET.Devices.DMX/DMXDeviceProvider.cs +++ b/RGB.NET.Devices.DMX/DMXDeviceProvider.cs @@ -51,8 +51,10 @@ namespace RGB.NET.Devices.DMX /// The to add. public void AddDeviceDefinition(IDMXDeviceDefinition deviceDefinition) => DeviceDefinitions.Add(deviceDefinition); + /// protected override void InitializeSDK() { } + /// protected override IEnumerable LoadDevices() { foreach (IDMXDeviceDefinition dmxDeviceDefinition in DeviceDefinitions) diff --git a/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs b/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs index 602acd5..a7606af 100644 --- a/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs +++ b/RGB.NET.Devices.DMX/E131/E131DeviceInfo.cs @@ -33,6 +33,7 @@ namespace RGB.NET.Devices.DMX.E131 /// public string Model { get; } + /// public object? LayoutMetadata { get; set; } /// diff --git a/RGB.NET.Devices.Debug/DebugDeviceProvider.cs b/RGB.NET.Devices.Debug/DebugDeviceProvider.cs index 5e9ab8b..ac9befa 100644 --- a/RGB.NET.Devices.Debug/DebugDeviceProvider.cs +++ b/RGB.NET.Devices.Debug/DebugDeviceProvider.cs @@ -55,8 +55,10 @@ namespace RGB.NET.Devices.Debug /// public void ClearFakeDeviceDefinitions() => _fakeDeviceDefinitions.Clear(); + /// protected override void InitializeSDK() { } + /// protected override IEnumerable LoadDevices() { foreach ((IDeviceLayout layout, Action>? updateLedsAction) in _fakeDeviceDefinitions) diff --git a/RGB.NET.Devices.Debug/DebugRGBDevice.cs b/RGB.NET.Devices.Debug/DebugRGBDevice.cs index fa11042..7a5181e 100644 --- a/RGB.NET.Devices.Debug/DebugRGBDevice.cs +++ b/RGB.NET.Devices.Debug/DebugRGBDevice.cs @@ -13,6 +13,9 @@ namespace RGB.NET.Devices.Debug { #region Properties & Fields + /// + /// Gets the layour used to describe this debug device. + /// public IDeviceLayout Layout { get; } private Action>? _updateLedsAction; diff --git a/RGB.NET.Devices.Debug/DebugRGBDeviceInfo.cs b/RGB.NET.Devices.Debug/DebugRGBDeviceInfo.cs index c2a5cc7..889cc5d 100644 --- a/RGB.NET.Devices.Debug/DebugRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Debug/DebugRGBDeviceInfo.cs @@ -22,6 +22,7 @@ namespace RGB.NET.Devices.Debug /// public string Model { get; } + /// public object? LayoutMetadata { get; set; } #endregion @@ -34,6 +35,7 @@ namespace RGB.NET.Devices.Debug /// The of the device. /// The manufacturer of the device. /// The model of the device. + /// Some custom data for this device provided by the layout. internal DebugRGBDeviceInfo(RGBDeviceType deviceType, string manufacturer, string model, object? customData) { this.DeviceType = deviceType; diff --git a/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs b/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs index 181e5a9..941c6a8 100644 --- a/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs +++ b/RGB.NET.Devices.Logitech/Enum/LogitechDeviceType.cs @@ -1,4 +1,6 @@ -namespace RGB.NET.Devices.Logitech +#pragma warning disable 1591 + +namespace RGB.NET.Devices.Logitech { /// /// Contains list of available logitech device types. diff --git a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs index f217795..6cd417d 100644 --- a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs +++ b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Logitech /// Initializes a new instance of the class. /// /// The generic information provided by Logitech for the device. + /// The queue used to update this device. protected LogitechRGBDevice(TDeviceInfo info, IUpdateQueue updateQueue) : base(info, updateQueue) { } diff --git a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs index dbddaaf..0f59afa 100644 --- a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs @@ -22,6 +22,7 @@ namespace RGB.NET.Devices.Logitech /// public string Model { get; } + /// public object? LayoutMetadata { get; set; } /// @@ -45,8 +46,6 @@ namespace RGB.NET.Devices.Logitech /// The represented device model. /// The lighting-capabilities of the device. /// The amount of zones the device is able to control. - /// The layout used to decide which images to load. - /// The path/name of the layout-file. internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps, int zones) { this.DeviceType = deviceType; diff --git a/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs b/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs index 661dd83..480f723 100644 --- a/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs +++ b/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs @@ -42,6 +42,9 @@ namespace RGB.NET.Devices.Logitech private const int VENDOR_ID = 0x046D; + /// + /// Gets the HID-definitions for per-key-devices. + /// public static HIDLoader PerKeyDeviceDefinitions { get; } = new(VENDOR_ID) { { 0xC32B, RGBDeviceType.Keyboard, "G910", LedMappings.PerKey, 0 }, @@ -60,6 +63,9 @@ namespace RGB.NET.Devices.Logitech { 0xC545, RGBDeviceType.Keyboard, "Lightspeed Keyboard Dongle", LedMappings.PerKey, 0 }, }; + /// + /// Gets the HID-definitions for per-zone-devices. + /// public static HIDLoader PerZoneDeviceDefinitions { get; } = new(VENDOR_ID) { { 0xC336, RGBDeviceType.Keyboard, "G213", LedMappings.ZoneKeyboard, (LogitechDeviceType.Keyboard, 2) }, @@ -83,6 +89,9 @@ namespace RGB.NET.Devices.Logitech { 0xAB5, RGBDeviceType.Speaker, "G733", LedMappings.ZoneSpeaker, (LogitechDeviceType.Speaker, 2) }, }; + /// + /// Gets the HID-definitions for per-device-devices. + /// public static HIDLoader PerDeviceDeviceDefinitions { get; } = new(VENDOR_ID) { { 0xC228, RGBDeviceType.Keyboard, "G19", LedMappings.Device, 0 }, @@ -117,6 +126,7 @@ namespace RGB.NET.Devices.Logitech #region Methods + /// protected override void InitializeSDK() { _perDeviceUpdateQueue = new LogitechPerDeviceUpdateQueue(GetUpdateTrigger()); @@ -128,6 +138,7 @@ namespace RGB.NET.Devices.Logitech _LogitechGSDK.LogiLedSaveCurrentLighting(); } + /// protected override IEnumerable GetLoadedDevices(RGBDeviceType loadFilter) { PerKeyDeviceDefinitions.LoadFilter = loadFilter; @@ -136,8 +147,8 @@ namespace RGB.NET.Devices.Logitech return base.GetLoadedDevices(loadFilter); } - - //TODO DarthAffe 04.03.2021: Rework device selection and configuration for HID-based providers + + /// protected override IEnumerable LoadDevices() { (HIDDeviceDefinition definition, HidDevice device) perKeyDevice = PerKeyDeviceDefinitions.GetConnectedDevices().FirstOrDefault(); diff --git a/RGB.NET.Devices.Msi/Generic/MsiRGBDevice.cs b/RGB.NET.Devices.Msi/Generic/MsiRGBDevice.cs index 888155b..0622ee7 100644 --- a/RGB.NET.Devices.Msi/Generic/MsiRGBDevice.cs +++ b/RGB.NET.Devices.Msi/Generic/MsiRGBDevice.cs @@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Msi /// Initializes a new instance of the class. /// /// The generic information provided by MSI for the device. + /// The update trigger used to update this device. protected MsiRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new MsiDeviceUpdateQueue(updateTrigger, info.MsiDeviceType)) { } diff --git a/RGB.NET.Devices.Msi/GraphicsCard/MsiGraphicsCardRGBDevice.cs b/RGB.NET.Devices.Msi/GraphicsCard/MsiGraphicsCardRGBDevice.cs index 629212c..1fe06b0 100644 --- a/RGB.NET.Devices.Msi/GraphicsCard/MsiGraphicsCardRGBDevice.cs +++ b/RGB.NET.Devices.Msi/GraphicsCard/MsiGraphicsCardRGBDevice.cs @@ -16,6 +16,8 @@ namespace RGB.NET.Devices.Msi /// Initializes a new instance of the class. /// /// The specific information provided by MSI for graphics cards. + /// The amount of leds on this device. + /// The update trigger used to update this device. internal MsiGraphicsCardRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Msi/Mainboard/MsiMainboardRGBDevice.cs b/RGB.NET.Devices.Msi/Mainboard/MsiMainboardRGBDevice.cs index 01f25ad..ad99030 100644 --- a/RGB.NET.Devices.Msi/Mainboard/MsiMainboardRGBDevice.cs +++ b/RGB.NET.Devices.Msi/Mainboard/MsiMainboardRGBDevice.cs @@ -16,6 +16,8 @@ namespace RGB.NET.Devices.Msi /// Initializes a new instance of the class. /// /// The specific information provided by MSI for the mainboard. + /// The amount of leds on this device. + /// The update trigger used to update this device. internal MsiMainboardRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Msi/Mouse/MsiMouseRGBDevice.cs b/RGB.NET.Devices.Msi/Mouse/MsiMouseRGBDevice.cs index 79ad777..584660b 100644 --- a/RGB.NET.Devices.Msi/Mouse/MsiMouseRGBDevice.cs +++ b/RGB.NET.Devices.Msi/Mouse/MsiMouseRGBDevice.cs @@ -16,6 +16,8 @@ namespace RGB.NET.Devices.Msi /// Initializes a new instance of the class. /// /// The specific information provided by MSI for the mouse. + /// The amount of leds on this device. + /// The update trigger used to update this device. internal MsiMouseRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Msi/MsiDeviceProvider.cs b/RGB.NET.Devices.Msi/MsiDeviceProvider.cs index 1be843d..a3e8c82 100644 --- a/RGB.NET.Devices.Msi/MsiDeviceProvider.cs +++ b/RGB.NET.Devices.Msi/MsiDeviceProvider.cs @@ -53,6 +53,7 @@ namespace RGB.NET.Devices.Msi #region Methods + /// protected override void InitializeSDK() { _MsiSDK.Reload(); @@ -62,6 +63,7 @@ namespace RGB.NET.Devices.Msi ThrowMsiError(errorCode, true); } + /// protected override IEnumerable LoadDevices() { int errorCode; diff --git a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs index aa040be..46f85d1 100644 --- a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs +++ b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs @@ -51,11 +51,11 @@ namespace RGB.NET.Devices.Novation _outputDevice.SendShort(message.Message); } - /// /// Creates a update-message out of a specified data set. /// - /// The data set to create the message from. + /// The key used to identify the LED to update. + /// The color to send. /// The message created out of the data set. protected abstract ShortMessage? CreateMessage(object key, in Color color); diff --git a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs index 1b9f073..20a6c59 100644 --- a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs +++ b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDevice.cs @@ -17,6 +17,7 @@ namespace RGB.NET.Devices.Novation /// Initializes a new instance of the class. /// /// The specific information provided by Novation for the launchpad + /// The update trigger used to update this device. internal NovationLaunchpadRGBDevice(NovationLaunchpadRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { @@ -44,8 +45,13 @@ namespace RGB.NET.Devices.Novation protected override object GetLedCustomData(LedId ledId) => GetDeviceMapping().TryGetValue(ledId, out (byte mode, byte id, int _, int __) data) ? (data.mode, data.id) : ((byte)0x00, (byte)0x00); // ReSharper restore RedundantCast + /// + /// Gets the mapping used to access the LEDs of the device based on . + /// + /// The mapping of the device. + /// Thrown if the value of is not known. protected virtual Dictionary GetDeviceMapping() - => DeviceInfo.LedIdMapping switch + => DeviceInfo.LedMapping switch { LedIdMappings.Current => LaunchpadIdMapping.CURRENT, LedIdMappings.Legacy => LaunchpadIdMapping.LEGACY, diff --git a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs index ce86e05..f1d73d1 100644 --- a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs @@ -10,7 +10,7 @@ namespace RGB.NET.Devices.Novation { #region Properties & Fields - internal LedIdMappings LedIdMapping { get; } + internal LedIdMappings LedMapping { get; } #endregion @@ -23,11 +23,11 @@ namespace RGB.NET.Devices.Novation /// The represented device model. /// /// The of the . - internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities, - LedIdMappings ledIdMapping) + /// A mapping of leds this device is initialized with. + internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities, LedIdMappings ledMapping) : base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities) { - this.LedIdMapping = ledIdMapping; + this.LedMapping = ledMapping; } #endregion diff --git a/RGB.NET.Devices.Novation/NovationDeviceProvider.cs b/RGB.NET.Devices.Novation/NovationDeviceProvider.cs index e0af6f2..1827616 100644 --- a/RGB.NET.Devices.Novation/NovationDeviceProvider.cs +++ b/RGB.NET.Devices.Novation/NovationDeviceProvider.cs @@ -41,8 +41,10 @@ namespace RGB.NET.Devices.Novation #region Methods + /// protected override void InitializeSDK() { } + /// protected override IEnumerable LoadDevices() { for (int index = 0; index < OutputDeviceBase.DeviceCount; index++) diff --git a/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs b/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs index 99b0ff0..5fc78f6 100644 --- a/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs +++ b/RGB.NET.Devices.PicoPi/Enum/UpdateMode.cs @@ -1,7 +1,11 @@ // ReSharper disable InconsistentNaming +#pragma warning disable 1591 namespace RGB.NET.Devices.PicoPi.Enum { + /// + /// Contains a list of possible ways of communication with the device. + /// public enum UpdateMode { Auto = 0x00, diff --git a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiBulkUpdateQueue.cs b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiBulkUpdateQueue.cs index a92b191..c7b7de0 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiBulkUpdateQueue.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiBulkUpdateQueue.cs @@ -3,6 +3,13 @@ using RGB.NET.Core; namespace RGB.NET.Devices.PicoPi { + /// + /// + /// Represents the update-queue performing updates for Pico-Pi bulk-devices. + /// + /// + /// Using this requires the libusb driver to be installed! + /// public class PicoPiBulkUpdateQueue : UpdateQueue { #region Properties & Fields @@ -16,6 +23,13 @@ namespace RGB.NET.Devices.PicoPi #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + /// The sdk used to access the device. + /// The channel to update. + /// The maximum amount of leds to update. public PicoPiBulkUpdateQueue(IDeviceUpdateTrigger updateTrigger, PicoPiSDK sdk, int channel, int ledCount) : base(updateTrigger) { @@ -29,6 +43,7 @@ namespace RGB.NET.Devices.PicoPi #region Methods + /// protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet) { Span buffer = _dataBuffer; diff --git a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiHIDUpdateQueue.cs b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiHIDUpdateQueue.cs index 1ac89ed..1a888ec 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiHIDUpdateQueue.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiHIDUpdateQueue.cs @@ -3,6 +3,10 @@ using RGB.NET.Core; namespace RGB.NET.Devices.PicoPi { + /// + /// + /// Represents the update-queue performing updates for Pico-Pi HID-devices. + /// public class PicoPiHIDUpdateQueue : UpdateQueue { #region Constants @@ -22,6 +26,13 @@ namespace RGB.NET.Devices.PicoPi #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + /// The sdk used to access the device. + /// The channel to update. + /// The maximum amount of leds to update. public PicoPiHIDUpdateQueue(IDeviceUpdateTrigger updateTrigger, PicoPiSDK sdk, int channel, int ledCount) : base(updateTrigger) { @@ -35,6 +46,7 @@ namespace RGB.NET.Devices.PicoPi #region Methods + /// protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet) { Span buffer = _dataBuffer; diff --git a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDevice.cs b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDevice.cs index d10e03d..88e7eea 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDevice.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDevice.cs @@ -2,6 +2,10 @@ namespace RGB.NET.Devices.PicoPi { + /// + /// + /// Represents a device based on an Raspberry Pi Pico. + /// public class PicoPiRGBDevice : AbstractRGBDevice { #region Properties & Fields @@ -12,6 +16,13 @@ namespace RGB.NET.Devices.PicoPi #region Constructors + /// + /// + /// Initializes a new instance of the class. + /// + /// The device info of this device. + /// The queue used to update this device. + /// A mapping of leds this device is initialized with. public PicoPiRGBDevice(PicoPiRGBDeviceInfo deviceInfo, IUpdateQueue updateQueue, LedMapping ledMapping) : base(deviceInfo, updateQueue) { diff --git a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDeviceInfo.cs b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDeviceInfo.cs index 5cd1a8e..e7e5d7a 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDeviceInfo.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiRGBDeviceInfo.cs @@ -2,19 +2,46 @@ namespace RGB.NET.Devices.PicoPi { + /// + /// Represents a generic information for a . + /// public class PicoPiRGBDeviceInfo : IRGBDeviceInfo { #region Properties & Fields + /// public RGBDeviceType DeviceType { get; } + + /// public string DeviceName { get; } + + /// public string Manufacturer => "RGB.NET"; + + /// public string Model { get; } + + /// public object? LayoutMetadata { get; set; } + /// + /// Gets the Id of the device. + /// public string Id { get; } + + /// + /// Gets the version of the device firmware. + /// public int Version { get; } + + /// + /// Gets the channel this device is using. + /// public int Channel { get; } + + /// + /// Gets the amount of LEDs on this device. + /// public int LedCount { get; } #endregion diff --git a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs index c2ad416..542730b 100644 --- a/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs +++ b/RGB.NET.Devices.PicoPi/PicoPi/PicoPiSDK.cs @@ -9,6 +9,9 @@ using RGB.NET.Core; namespace RGB.NET.Devices.PicoPi { + /// + /// Represents a SDK to access devices based on a Raspberry Pi Pico. + /// public class PicoPiSDK : IDisposable { #region Constants @@ -49,16 +52,34 @@ namespace RGB.NET.Devices.PicoPi private int _bulkTransferLength; + /// + /// Gets if updates via the Bulk-Enbpoint are possible. + /// public bool IsBulkSupported { get; private set; } + /// + /// Gets the Id of the device. + /// public string Id { get; } + + /// + /// Gets the version of the device firmware. + /// public int Version { get; } + + /// + /// Gets a collection of channels, led counts and pins that are available on this device. + /// public IReadOnlyList<(int channel, int ledCount, int pin)> Channels { get; } #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The underlying hid device. public PicoPiSDK(HidDevice device) { this._hidDevice = device; @@ -79,6 +100,11 @@ namespace RGB.NET.Devices.PicoPi #region Methods + /// + /// Configures the amount of leds to update on the specified channels. + /// + /// This is a configuration function. The value is persistent on the device. + /// The values to set on the device. public void SetLedCounts(params (int channel, int ledCount)[] ledCounts) { byte[] data = new byte[Channels.Count + 2]; @@ -92,6 +118,11 @@ namespace RGB.NET.Devices.PicoPi SendHID(data); } + /// + /// Configures the pins used by the specified channels. + /// + /// This is a configuration function. The value is persistent on the device. + /// T values to set on the device. public void SetPins(params (int channel, int pin)[] pins) { byte[] data = new byte[Channels.Count + 2]; @@ -173,6 +204,13 @@ namespace RGB.NET.Devices.PicoPi } } + /// + /// Sends a update to the device using the HID-endpoint. + /// + /// The data packet to send. + /// The channel to update. + /// The chunk id of the packet. (Required if packets are fragmented.) + /// A value indicating if the device should update directly after receiving this packet. (If packets are fragmented this should only be true for the last chunk.) public void SendHidUpdate(in Span data, int channel, int chunk, bool update) { if (data.Length == 0) return; @@ -186,6 +224,14 @@ namespace RGB.NET.Devices.PicoPi SendHID(_hidSendBuffer); } + /// + /// Sends a update to the device using the bulk-endpoint. + /// + /// + /// Silently fails if not bulk-updates are supported. (Check ) + /// + /// The data packet to send. + /// The channel to update. public void SendBulkUpdate(in Span data, int channel) { if ((data.Length == 0) || !IsBulkSupported) return; @@ -200,6 +246,9 @@ namespace RGB.NET.Devices.PicoPi _bulkTransferLength += payloadSize; } + /// + /// Flushing the bulk endpoint, causing the device to update. + /// public void FlushBulk() { if (_bulkTransferLength == 0) return; @@ -216,6 +265,7 @@ namespace RGB.NET.Devices.PicoPi private byte[] Read() => _hidStream.Read(); + /// public void Dispose() { _hidStream.Dispose(); diff --git a/RGB.NET.Devices.PicoPi/PicoPiDeviceProvider.cs b/RGB.NET.Devices.PicoPi/PicoPiDeviceProvider.cs index 3b7f861..b8ffd69 100644 --- a/RGB.NET.Devices.PicoPi/PicoPiDeviceProvider.cs +++ b/RGB.NET.Devices.PicoPi/PicoPiDeviceProvider.cs @@ -31,6 +31,9 @@ namespace RGB.NET.Devices.PicoPi /// public static PicoPiDeviceProvider Instance => _instance ?? new PicoPiDeviceProvider(); + /// + /// Gets the HID-definitions for PicoPi-devices. + /// public static HIDLoader DeviceDefinitions { get; } = new(PicoPiSDK.VENDOR_ID) { { PicoPiSDK.HID_BULK_CONTROLLER_PID, RGBDeviceType.LedStripe, "WS2812B-Controller", LedMappings.StripeMapping, 0 }, @@ -38,6 +41,10 @@ namespace RGB.NET.Devices.PicoPi private readonly List _sdks = new(); + /// + /// Gets or sets the endpoint used to update devices. (default ). + /// If auto is set it automatically is using bulk-updates for devies with more than 40 LEDs if supported. Else HID is used. + /// public UpdateMode UpdateMode { get; set; } = UpdateMode.Auto; #endregion @@ -58,6 +65,7 @@ namespace RGB.NET.Devices.PicoPi #region Methods + /// protected override void InitializeSDK() { } /// @@ -108,6 +116,7 @@ namespace RGB.NET.Devices.PicoPi } } + /// protected override void Reset() { base.Reset(); diff --git a/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkRGBDevice.cs b/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkRGBDevice.cs index 1fc51f9..579eadc 100644 --- a/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkRGBDevice.cs +++ b/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkRGBDevice.cs @@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the chroma link. + /// The update trigger used to update this device. internal RazerChromaLinkRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new RazerChromaLinkUpdateQueue(updateTrigger)) { diff --git a/RGB.NET.Devices.Razer/Headset/RazerHeadsetRGBDevice.cs b/RGB.NET.Devices.Razer/Headset/RazerHeadsetRGBDevice.cs index 16d4129..1d1e656 100644 --- a/RGB.NET.Devices.Razer/Headset/RazerHeadsetRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Headset/RazerHeadsetRGBDevice.cs @@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the headset. + /// The update trigger used to update this device. internal RazerHeadsetRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new RazerHeadsetUpdateQueue(updateTrigger)) { diff --git a/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs b/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs index 2d17914..e4a7f01 100644 --- a/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardRGBDevice.cs @@ -27,6 +27,8 @@ namespace RGB.NET.Devices.Razer /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the keyboard. + /// The update trigger used to update this device. + /// A mapping of leds this device is initialized with. internal RazerKeyboardRGBDevice(RazerKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger, LedMapping ledMapping) : base(info, new RazerKeyboardUpdateQueue(updateTrigger)) { diff --git a/RGB.NET.Devices.Razer/Keypad/RazerKeypadRGBDevice.cs b/RGB.NET.Devices.Razer/Keypad/RazerKeypadRGBDevice.cs index f2a1987..915e8d8 100644 --- a/RGB.NET.Devices.Razer/Keypad/RazerKeypadRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Keypad/RazerKeypadRGBDevice.cs @@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the keypad. + /// The update trigger used to update this device. internal RazerKeypadRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new RazerKeypadUpdateQueue(updateTrigger)) { diff --git a/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs b/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs index eec4dab..06015ad 100644 --- a/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Mouse/RazerMouseRGBDevice.cs @@ -25,6 +25,8 @@ namespace RGB.NET.Devices.Razer /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the mouse. + /// The update trigger used to update this device. + /// A mapping of leds this device is initialized with. internal RazerMouseRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger, LedMapping ledMapping) : base(info, new RazerMouseUpdateQueue(updateTrigger)) { diff --git a/RGB.NET.Devices.Razer/Mousepad/RazerMousepadRGBDevice.cs b/RGB.NET.Devices.Razer/Mousepad/RazerMousepadRGBDevice.cs index 2c02bfa..f50c20f 100644 --- a/RGB.NET.Devices.Razer/Mousepad/RazerMousepadRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Mousepad/RazerMousepadRGBDevice.cs @@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer /// Initializes a new instance of the class. /// /// The specific information provided by CUE for the mousepad. + /// The update trigger used to update this device. internal RazerMousepadRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new RazerMousepadUpdateQueue(updateTrigger)) { diff --git a/RGB.NET.Devices.Razer/RazerDeviceProvider.cs b/RGB.NET.Devices.Razer/RazerDeviceProvider.cs index 2048a5f..3d0927d 100644 --- a/RGB.NET.Devices.Razer/RazerDeviceProvider.cs +++ b/RGB.NET.Devices.Razer/RazerDeviceProvider.cs @@ -44,6 +44,9 @@ namespace RGB.NET.Devices.Razer private const int VENDOR_ID = 0x1532; + /// + /// Gets the HID-definitions for Razer-devices. + /// public static HIDLoader DeviceDefinitions { get; } = new(VENDOR_ID) { // Keyboards @@ -214,6 +217,7 @@ namespace RGB.NET.Devices.Razer #region Methods + /// protected override void InitializeSDK() { TryUnInit(); @@ -225,6 +229,7 @@ namespace RGB.NET.Devices.Razer ThrowRazerError(error, true); } + /// protected override IEnumerable GetLoadedDevices(RGBDeviceType loadFilter) { DeviceDefinitions.LoadFilter = loadFilter; @@ -250,6 +255,7 @@ namespace RGB.NET.Devices.Razer return devices; } + /// protected override IEnumerable LoadDevices() { // Only take the first device of each endpoint type, the Razer SDK doesn't allow separate control over multiple devices using the same endpoint diff --git a/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesDeviceType.cs b/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesDeviceType.cs index 3e68226..31bce28 100644 --- a/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesDeviceType.cs +++ b/RGB.NET.Devices.SteelSeries/Enum/SteelSeriesDeviceType.cs @@ -1,4 +1,6 @@ -namespace RGB.NET.Devices.SteelSeries +#pragma warning disable 1591 + +namespace RGB.NET.Devices.SteelSeries { // DarthAffe 09.07.2020: Review the LISP-Handler in SteelSeriesSDK after adding new device-types! They need to be initialized. public enum SteelSeriesDeviceType diff --git a/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesRGBDeviceInfo.cs b/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesRGBDeviceInfo.cs index 1885db8..e907a07 100644 --- a/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesRGBDeviceInfo.cs +++ b/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesRGBDeviceInfo.cs @@ -25,6 +25,9 @@ namespace RGB.NET.Devices.SteelSeries /// public object? LayoutMetadata { get; set; } + /// + /// Gets the type of this device used in the SDK. + /// public SteelSeriesDeviceType SteelSeriesDeviceType { get; } #endregion @@ -36,9 +39,7 @@ namespace RGB.NET.Devices.SteelSeries /// /// The type of the . /// The represented device model. - /// The lighting-capabilities of the device. - /// The layout used to decide which images to load. - /// The path/name of the layout-file. + /// The type of this device used in the SDK. internal SteelSeriesRGBDeviceInfo(RGBDeviceType deviceType, string model, SteelSeriesDeviceType steelSeriesDeviceType) { this.DeviceType = deviceType; diff --git a/RGB.NET.Devices.SteelSeries/SteelSeriesDeviceProvider.cs b/RGB.NET.Devices.SteelSeries/SteelSeriesDeviceProvider.cs index 81ca9c5..244e0a3 100644 --- a/RGB.NET.Devices.SteelSeries/SteelSeriesDeviceProvider.cs +++ b/RGB.NET.Devices.SteelSeries/SteelSeriesDeviceProvider.cs @@ -8,7 +8,7 @@ namespace RGB.NET.Devices.SteelSeries { /// /// - /// Represents a device provider responsible for SteelSeries- devices. + /// Represents a device provider responsible for SteelSeries-devices. /// public class SteelSeriesDeviceProvider : AbstractRGBDeviceProvider { @@ -22,6 +22,9 @@ namespace RGB.NET.Devices.SteelSeries private const int VENDOR_ID = 0x1038; + /// + /// Gets the HID-definitions for SteelSeries-devices. + /// public static HIDLoader DeviceDefinitions { get; } = new(VENDOR_ID) { //Mice diff --git a/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBDevice.cs b/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBDevice.cs index 545dccd..d948cca 100644 --- a/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBDevice.cs +++ b/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBDevice.cs @@ -26,9 +26,10 @@ namespace RGB.NET.Devices.WS281X.Arduino /// /// Initializes a new instance of the class. /// - /// The update trigger used by this queue. + /// The device info of this device. /// The update queue performing updates for this device. /// The channel (as defined in the arduino-sketch) this device is attached to. + /// The amount of leds on this device. public ArduinoWS2812USBDevice(ArduinoWS2812USBDeviceInfo deviceInfo, ArduinoWS2812USBUpdateQueue updateQueue, int channel, int ledCount) : base(deviceInfo, updateQueue) { diff --git a/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBUpdateQueue.cs b/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBUpdateQueue.cs index 9263e64..5b77654 100644 --- a/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBUpdateQueue.cs +++ b/RGB.NET.Devices.WS281X/Arduino/ArduinoWS2812USBUpdateQueue.cs @@ -31,8 +31,7 @@ namespace RGB.NET.Devices.WS281X.Arduino /// Initializes a new instance of the class. /// /// The update trigger used by this queue. - /// The name of the serial-port to connect to. - /// The baud-rate used by the serial-connection. + /// The serial connection used to access the device. public ArduinoWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection) : base(updateTrigger, serialConnection) { } diff --git a/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBDevice.cs b/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBDevice.cs index 9ff359d..aeabb5e 100644 --- a/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBDevice.cs +++ b/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBDevice.cs @@ -24,8 +24,10 @@ namespace RGB.NET.Devices.WS281X.Bitwizard /// /// Initializes a new instance of the class. /// - /// The update trigger used by this queue. + /// The device info of this device. /// The update queue performing updates for this device. + /// The offset used to access the leds on this device. + /// The amount of leds on this device. public BitwizardWS2812USBDevice(BitwizardWS2812USBDeviceInfo deviceInfo, BitwizardWS2812USBUpdateQueue updateQueue, int ledOffset, int ledCount) : base(deviceInfo, updateQueue) { diff --git a/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBUpdateQueue.cs b/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBUpdateQueue.cs index 623f0fe..022f1fe 100644 --- a/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBUpdateQueue.cs +++ b/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS2812USBUpdateQueue.cs @@ -17,8 +17,7 @@ namespace RGB.NET.Devices.WS281X.Bitwizard /// Initializes a new instance of the class. /// /// The update trigger used by this queue. - /// The name of the serial-port to connect to. - /// The baud-rate used by the serial-connection. + /// The serial connection used to access the device. public BitwizardWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection) : base(updateTrigger, serialConnection) { } diff --git a/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS281XDeviceDefinition.cs b/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS281XDeviceDefinition.cs index 558548a..0443fa7 100644 --- a/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS281XDeviceDefinition.cs +++ b/RGB.NET.Devices.WS281X/Bitwizard/BitwizardWS281XDeviceDefinition.cs @@ -36,6 +36,9 @@ namespace RGB.NET.Devices.WS281X.Bitwizard /// public string? Name { get; set; } + /// + /// Gets a list of LED-strips configured on this device. + /// public List<(int pin, int stripLength)> Strips { get; } = new(); /// @@ -52,6 +55,7 @@ namespace RGB.NET.Devices.WS281X.Bitwizard /// Initializes a new instance of the class. /// /// The serial connection used for the device. + /// A list of LED-strips connected to this device. public BitwizardWS281XDeviceDefinition(ISerialConnection serialConnection, params (int pin, int stripLength)[] strips) { this.SerialConnection = serialConnection; @@ -64,6 +68,7 @@ namespace RGB.NET.Devices.WS281X.Bitwizard /// /// The name of the serial-port to connect to. /// The baud-rate of the serial-connection. + /// A list of LED-strips connected to this device. public BitwizardWS281XDeviceDefinition(string port, int baudRate = 115200, params (int pin, int stripLength)[] strips) { SerialConnection = new SerialPortConnection(port, baudRate); diff --git a/RGB.NET.Devices.WS281X/Generic/SerialPortConnection.cs b/RGB.NET.Devices.WS281X/Generic/SerialPortConnection.cs index fded9dc..822c845 100644 --- a/RGB.NET.Devices.WS281X/Generic/SerialPortConnection.cs +++ b/RGB.NET.Devices.WS281X/Generic/SerialPortConnection.cs @@ -28,6 +28,11 @@ namespace RGB.NET.Devices.WS281X #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The name of the serial-port to connect to. + /// The baud-rate used by the serial-connection. public SerialPortConnection(string port, int baudRate) { SerialPort = new SerialPort(port, baudRate); diff --git a/RGB.NET.Devices.WS281X/Generic/SerialPortUpdateQueue.cs b/RGB.NET.Devices.WS281X/Generic/SerialPortUpdateQueue.cs index 7bee162..4b3d378 100644 --- a/RGB.NET.Devices.WS281X/Generic/SerialPortUpdateQueue.cs +++ b/RGB.NET.Devices.WS281X/Generic/SerialPortUpdateQueue.cs @@ -33,8 +33,7 @@ namespace RGB.NET.Devices.WS281X /// Initializes a new instance of the class. /// /// The update trigger used by this queue. - /// The name of the serial-port to connect to. - /// The baud-rate used by the serial-connection. + /// The serial connection used to access the device. internal SerialConnectionUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection) : base(updateTrigger) { diff --git a/RGB.NET.Devices.WS281X/NodeMCU/NodeMCUWS2812USBDevice.cs b/RGB.NET.Devices.WS281X/NodeMCU/NodeMCUWS2812USBDevice.cs index 3e59cd1..7d540b5 100644 --- a/RGB.NET.Devices.WS281X/NodeMCU/NodeMCUWS2812USBDevice.cs +++ b/RGB.NET.Devices.WS281X/NodeMCU/NodeMCUWS2812USBDevice.cs @@ -28,11 +28,12 @@ namespace RGB.NET.Devices.WS281X.NodeMCU /// /// Initializes a new instance of the class. /// - /// The update trigger used by this queue. + /// The device info of this device. /// The update queue performing updates for this device. /// The channel (as defined in the NodeMCU-sketch) this device is attached to. - public NodeMCUWS2812USBDevice(NodeMCUWS2812USBDeviceInfo info, NodeMCUWS2812USBUpdateQueue updateQueue, int channel, int ledCount) - : base(info, updateQueue) + /// The amount of leds on this device. + public NodeMCUWS2812USBDevice(NodeMCUWS2812USBDeviceInfo deviceInfo, NodeMCUWS2812USBUpdateQueue updateQueue, int channel, int ledCount) + : base(deviceInfo, updateQueue) { this.Channel = channel; diff --git a/RGB.NET.Devices.Wooting/Generic/WootingRGBDevice.cs b/RGB.NET.Devices.Wooting/Generic/WootingRGBDevice.cs index b7a4d22..11c91f9 100644 --- a/RGB.NET.Devices.Wooting/Generic/WootingRGBDevice.cs +++ b/RGB.NET.Devices.Wooting/Generic/WootingRGBDevice.cs @@ -16,6 +16,7 @@ namespace RGB.NET.Devices.Wooting.Generic /// Initializes a new instance of the class. /// /// The generic information provided by Wooting for the device. + /// The update trigger used to update this device. protected WootingRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, new WootingUpdateQueue(updateTrigger)) { } diff --git a/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDevice.cs b/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDevice.cs index 2f7ac90..4e643bd 100644 --- a/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDevice.cs @@ -24,6 +24,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard /// Initializes a new instance of the class. /// /// The specific information provided by Wooting for the keyboard + /// The update trigger used to update this device. internal WootingKeyboardRGBDevice(WootingKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) : base(info, updateTrigger) { diff --git a/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDeviceInfo.cs b/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDeviceInfo.cs index 69368be..f2dcfdf 100644 --- a/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Wooting/Keyboard/WootingKeyboardRGBDeviceInfo.cs @@ -23,7 +23,6 @@ namespace RGB.NET.Devices.Wooting.Keyboard /// Internal constructor of managed . /// /// The index of the . - /// The of the . internal WootingKeyboardRGBDeviceInfo(WootingDevicesIndexes deviceIndex) : base(RGBDeviceType.Keyboard, deviceIndex) { } diff --git a/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs b/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs index 8d88fd1..6c06d35 100644 --- a/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs +++ b/RGB.NET.Devices.Wooting/WootingDeviceProvider.cs @@ -53,6 +53,7 @@ namespace RGB.NET.Devices.Wooting #region Methods + /// protected override void InitializeSDK() { lock (_WootingSDK.SdkLock) @@ -61,6 +62,7 @@ namespace RGB.NET.Devices.Wooting } } + /// protected override IEnumerable LoadDevices() { lock (_WootingSDK.SdkLock) From 4dbeaf802a1e9dd95f90c93130e3ce47cb081cf0 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 1 Aug 2021 16:53:21 +0200 Subject: [PATCH 5/6] Fixed code issues --- RGB.NET.Core/Decorators/IDecoratable.cs | 2 +- RGB.NET.Core/Devices/AbstractRGBDevice.cs | 6 +++--- RGB.NET.Core/Devices/IRGBDevice.cs | 2 +- RGB.NET.Core/Extensions/RectangleExtensions.cs | 2 +- RGB.NET.Core/Groups/AbstractLedGroup.cs | 2 +- RGB.NET.Core/MVVM/AbstractBindable.cs | 4 ++-- RGB.NET.Core/Positioning/Rectangle.cs | 8 ++++---- RGB.NET.Core/RGB.NET.Core.csproj.DotSettings | 3 ++- RGB.NET.Core/RGBSurface.cs | 2 +- .../RGB.NET.Devices.Asus.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.CoolerMaster.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.Corsair.csproj.DotSettings | 3 ++- RGB.NET.Devices.DMX/E131/E131DMXDeviceDefinition.cs | 4 ++-- .../RGB.NET.Devices.DMX.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.Logitech.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.Msi.csproj.DotSettings | 3 ++- .../Launchpad/NovationLaunchpadRGBDeviceInfo.cs | 2 +- .../RGB.NET.Devices.Novation.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.PicoPi.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.Razer.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.SteelSeries.csproj.DotSettings | 3 ++- .../RGB.NET.Devices.WS281X.csproj.DotSettings | 3 ++- RGB.NET.Presets/RGB.NET.Presets.csproj.DotSettings | 3 ++- RGB.NET.Presets/Textures/Gradients/AbstractGradient.cs | 4 ++-- RGB.NET.Presets/Textures/Gradients/LinearGradient.cs | 2 +- 25 files changed, 46 insertions(+), 33 deletions(-) diff --git a/RGB.NET.Core/Decorators/IDecoratable.cs b/RGB.NET.Core/Decorators/IDecoratable.cs index 781d9f1..2892638 100644 --- a/RGB.NET.Core/Decorators/IDecoratable.cs +++ b/RGB.NET.Core/Decorators/IDecoratable.cs @@ -13,7 +13,7 @@ namespace RGB.NET.Core /// /// Represents a basic decoratable for a specific type of /// - /// + /// The type of decorators this decoratable can be decorated with. public interface IDecoratable : IDecoratable where T : IDecorator { diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs index f851f41..5f9e9bf 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs @@ -189,10 +189,10 @@ namespace RGB.NET.Core } /// - /// + /// Gets the custom data associated with the specified LED. /// - /// - /// + /// The id of the led. + /// The custom data for the specified LED. protected virtual object? GetLedCustomData(LedId ledId) => null; /// diff --git a/RGB.NET.Core/Devices/IRGBDevice.cs b/RGB.NET.Core/Devices/IRGBDevice.cs index 28c2dde..b058971 100644 --- a/RGB.NET.Core/Devices/IRGBDevice.cs +++ b/RGB.NET.Core/Devices/IRGBDevice.cs @@ -51,7 +51,7 @@ namespace RGB.NET.Core /// /// The to check. /// The minimal percentage overlay a must have with the to be taken into the list. - /// + /// A enumerable of leds inside the specified rectangle. IEnumerable this[Rectangle referenceRect, double minOverlayPercentage = 0.5] { get; } #endregion diff --git a/RGB.NET.Core/Extensions/RectangleExtensions.cs b/RGB.NET.Core/Extensions/RectangleExtensions.cs index 4b7104a..ea0dde7 100644 --- a/RGB.NET.Core/Extensions/RectangleExtensions.cs +++ b/RGB.NET.Core/Extensions/RectangleExtensions.cs @@ -75,7 +75,7 @@ namespace RGB.NET.Core /// Calculates the representing the intersection of this and the one provided as parameter. /// /// The rectangle to calculate the intersection for. - /// The intersecting + /// The intersecting . /// A new representing the intersection this and the one provided as parameter. public static Rectangle CalculateIntersection(this in Rectangle rect, in Rectangle intersectingRectangle) { diff --git a/RGB.NET.Core/Groups/AbstractLedGroup.cs b/RGB.NET.Core/Groups/AbstractLedGroup.cs index c42de03..514a680 100644 --- a/RGB.NET.Core/Groups/AbstractLedGroup.cs +++ b/RGB.NET.Core/Groups/AbstractLedGroup.cs @@ -42,7 +42,7 @@ namespace RGB.NET.Core /// /// Gets a enumerable containing all leds in this group. /// - /// + /// A enumerable containing all leds of this group. protected abstract IEnumerable GetLeds(); /// diff --git a/RGB.NET.Core/MVVM/AbstractBindable.cs b/RGB.NET.Core/MVVM/AbstractBindable.cs index 5d41f1c..92a3cd8 100644 --- a/RGB.NET.Core/MVVM/AbstractBindable.cs +++ b/RGB.NET.Core/MVVM/AbstractBindable.cs @@ -21,12 +21,12 @@ namespace RGB.NET.Core #region Methods /// - /// Checks if the property already matches the desirec value or needs to be updated. + /// Checks if the property already matches the desired value or needs to be updated. /// /// Type of the property. /// Reference to the backing-filed. /// Value to apply. - /// + /// true if the value needs to be updated; otherweise false. [MethodImpl(MethodImplOptions.AggressiveInlining)] protected virtual bool RequiresUpdate(ref T storage, T value) => !Equals(storage, value); diff --git a/RGB.NET.Core/Positioning/Rectangle.cs b/RGB.NET.Core/Positioning/Rectangle.cs index 466c312..36715a1 100644 --- a/RGB.NET.Core/Positioning/Rectangle.cs +++ b/RGB.NET.Core/Positioning/Rectangle.cs @@ -78,7 +78,7 @@ namespace RGB.NET.Core /// Initializes a new instance of the class using the specified array of . /// The and is calculated to completely contain all rectangles provided as parameters. /// - /// The array of used to calculate the and + /// The array of used to calculate the and . public Rectangle(params Rectangle[] rectangles) : this(rectangles.AsEnumerable()) { } @@ -87,7 +87,7 @@ namespace RGB.NET.Core /// Initializes a new instance of the class using the specified list of . /// The and is calculated to completely contain all rectangles provided as parameters. /// - /// The list of used to calculate the and + /// The list of used to calculate the and . public Rectangle(IEnumerable rectangles) { bool hasPoint = false; @@ -116,7 +116,7 @@ namespace RGB.NET.Core /// Initializes a new instance of the class using the specified array of . /// The and is calculated to contain all points provided as parameters. /// - /// The array of used to calculate the and + /// The array of used to calculate the and . public Rectangle(params Point[] points) : this(points.AsEnumerable()) { } @@ -126,7 +126,7 @@ namespace RGB.NET.Core /// Initializes a new instance of the class using the specified list of . /// The and is calculated to contain all points provided as parameters. /// - /// The list of used to calculate the and + /// The list of used to calculate the and . public Rectangle(IEnumerable points) : this() { diff --git a/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings b/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings index 9d38d8a..bf7655f 100644 --- a/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings +++ b/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings @@ -24,4 +24,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Core/RGBSurface.cs b/RGB.NET.Core/RGBSurface.cs index 669c044..6b9d726 100644 --- a/RGB.NET.Core/RGBSurface.cs +++ b/RGB.NET.Core/RGBSurface.cs @@ -83,7 +83,7 @@ namespace RGB.NET.Core /// /// Represents the event-handler of the -event. /// - /// + /// The arguments provided by the event. public delegate void SurfaceLayoutChangedEventHandler(SurfaceLayoutChangedEventArgs args); #endregion diff --git a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings index 942f886..e6bee89 100644 --- a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings +++ b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings @@ -8,4 +8,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj.DotSettings b/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj.DotSettings index 44309b1..1590a7c 100644 --- a/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj.DotSettings +++ b/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj.DotSettings @@ -3,4 +3,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings index 0501b9d..f37e8f8 100644 --- a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings +++ b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings @@ -17,4 +17,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.DMX/E131/E131DMXDeviceDefinition.cs b/RGB.NET.Devices.DMX/E131/E131DMXDeviceDefinition.cs index ca37238..f1e5f12 100644 --- a/RGB.NET.Devices.DMX/E131/E131DMXDeviceDefinition.cs +++ b/RGB.NET.Devices.DMX/E131/E131DMXDeviceDefinition.cs @@ -62,9 +62,9 @@ namespace RGB.NET.Devices.DMX.E131 #region Constructors /// - /// + /// Initializes a new instance of the class. /// - /// + /// The hostname of the device. public E131DMXDeviceDefinition(string hostname) { this.Hostname = hostname; diff --git a/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj.DotSettings b/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj.DotSettings index acc5fca..a54436d 100644 --- a/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj.DotSettings +++ b/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj.DotSettings @@ -1,2 +1,3 @@  - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj.DotSettings b/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj.DotSettings index e94069e..cb84f1e 100644 --- a/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj.DotSettings +++ b/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj.DotSettings @@ -6,4 +6,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj.DotSettings b/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj.DotSettings index bec0f75..d0b9b63 100644 --- a/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj.DotSettings +++ b/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj.DotSettings @@ -3,4 +3,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs index f1d73d1..6d06b06 100644 --- a/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Novation/Launchpad/NovationLaunchpadRGBDeviceInfo.cs @@ -21,7 +21,7 @@ namespace RGB.NET.Devices.Novation /// Internal constructor of managed . /// /// The represented device model. - /// + /// The id of the device. /// The of the . /// A mapping of leds this device is initialized with. internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities, LedIdMappings ledMapping) diff --git a/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj.DotSettings b/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj.DotSettings index b5910ca..a290ae5 100644 --- a/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj.DotSettings +++ b/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj.DotSettings @@ -2,4 +2,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj.DotSettings b/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj.DotSettings index 2f92998..22c2a5d 100644 --- a/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj.DotSettings +++ b/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj.DotSettings @@ -1,2 +1,3 @@  - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj.DotSettings b/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj.DotSettings index 1e5aa14..323fe52 100644 --- a/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj.DotSettings +++ b/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj.DotSettings @@ -8,4 +8,5 @@ True True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj.DotSettings b/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj.DotSettings index 20d4792..a98175d 100644 --- a/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj.DotSettings +++ b/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj.DotSettings @@ -1,4 +1,5 @@  True True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj.DotSettings b/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj.DotSettings index acc5fca..a54436d 100644 --- a/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj.DotSettings +++ b/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj.DotSettings @@ -1,2 +1,3 @@  - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Presets/RGB.NET.Presets.csproj.DotSettings b/RGB.NET.Presets/RGB.NET.Presets.csproj.DotSettings index 3af07cd..9b6455c 100644 --- a/RGB.NET.Presets/RGB.NET.Presets.csproj.DotSettings +++ b/RGB.NET.Presets/RGB.NET.Presets.csproj.DotSettings @@ -2,4 +2,5 @@ False False True - True \ No newline at end of file + True + \ No newline at end of file diff --git a/RGB.NET.Presets/Textures/Gradients/AbstractGradient.cs b/RGB.NET.Presets/Textures/Gradients/AbstractGradient.cs index e52788c..7085d5c 100644 --- a/RGB.NET.Presets/Textures/Gradients/AbstractGradient.cs +++ b/RGB.NET.Presets/Textures/Gradients/AbstractGradient.cs @@ -94,8 +94,8 @@ namespace RGB.NET.Presets.Textures.Gradients /// /// Clips the offset and ensures, that it is inside the bounds of the stop list. /// - /// - /// + /// The offset to clip. + /// The clipped offset. protected float ClipOffset(float offset) { float max = GradientStops.Max(stop => stop.Offset); diff --git a/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs b/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs index 9c27d08..fa13f43 100644 --- a/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs +++ b/RGB.NET.Presets/Textures/Gradients/LinearGradient.cs @@ -111,7 +111,7 @@ namespace RGB.NET.Presets.Textures.Gradients /// The reference offset. /// The ordered list of to choose from. /// Bool indicating if the gradient should be wrapped or not. - /// + /// The two s encapsulating the specified offset. protected virtual (GradientStop gsBefore, GradientStop gsAfter) GetEnclosingGradientStops(float offset, LinkedList orderedStops, bool wrap) { LinkedList gradientStops = new(orderedStops); From e279ea583e67caee9aaf97517e7ddba7a72cb1a7 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 1 Aug 2021 17:22:51 +0200 Subject: [PATCH 6/6] Replaced deprecated features and updated nuget packages --- RGB.NET.Core/RGB.NET.Core.csproj | 16 ++++++++++------ .../RGB.NET.Devices.Asus.csproj | 15 +++++++++------ .../RGB.NET.Devices.CoolerMaster.csproj | 15 +++++++++------ .../RGB.NET.Devices.Corsair.csproj | 15 +++++++++------ RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj | 15 +++++++++------ .../RGB.NET.Devices.Debug.csproj | 15 +++++++++------ .../RGB.NET.Devices.Logitech.csproj | 15 +++++++++------ RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj | 15 +++++++++------ .../RGB.NET.Devices.Novation.csproj | 15 +++++++++------ .../RGB.NET.Devices.PicoPi.csproj | 15 +++++++++------ .../RGB.NET.Devices.Razer.csproj | 15 +++++++++------ .../RGB.NET.Devices.SteelSeries.csproj | 15 +++++++++------ .../RGB.NET.Devices.WS281X.csproj | 17 ++++++++++------- .../RGB.NET.Devices.Wooting.csproj | 15 +++++++++------ RGB.NET.HID/RGB.NET.HID.csproj | 13 ++++++++----- RGB.NET.Layout/RGB.NET.Layout.csproj | 13 ++++++++----- RGB.NET.Presets/RGB.NET.Presets.csproj | 15 +++++++++------ Resources/icon.png | Bin 0 -> 21096 bytes .../RGB.NET.Core.Tests.csproj | 6 +++--- 19 files changed, 156 insertions(+), 104 deletions(-) create mode 100644 Resources/icon.png diff --git a/RGB.NET.Core/RGB.NET.Core.csproj b/RGB.NET.Core/RGB.NET.Core.csproj index 67fe585..c111d9c 100644 --- a/RGB.NET.Core/RGB.NET.Core.csproj +++ b/RGB.NET.Core/RGB.NET.Core.csproj @@ -15,11 +15,10 @@ RGB.NET.Core Core-Module of RGB.NET Core-Module of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,19 +33,24 @@ true True True + pdbonly + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + + \ No newline at end of file diff --git a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj index 3b81186..e449020 100644 --- a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj +++ b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Asus Asus-Device-Implementations of RGB.NET Asus-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj b/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj index 2c9bfb1..d3addb8 100644 --- a/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj +++ b/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.CoolerMaster Cooler Master-Device-Implementations of RGB.NET Cooler Master-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj index c6b3f48..6c0dfd9 100644 --- a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj +++ b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Corsair Corsair-Device-Implementations of RGB.NET Corsair-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj b/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj index ed42a6c..706b0c2 100644 --- a/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj +++ b/RGB.NET.Devices.DMX/RGB.NET.Devices.DMX.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.DMX DMX-Device-Implementations of RGB.NET DMX-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.Debug/RGB.NET.Devices.Debug.csproj b/RGB.NET.Devices.Debug/RGB.NET.Devices.Debug.csproj index 646da10..5792bd6 100644 --- a/RGB.NET.Devices.Debug/RGB.NET.Devices.Debug.csproj +++ b/RGB.NET.Devices.Debug/RGB.NET.Devices.Debug.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Debug Debug-Device-Implementations of RGB.NET Debug-Device-Implementations of RGB.NET, a C# (.NET) library - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj b/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj index d8ff36b..a5ec8df 100644 --- a/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj +++ b/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Logitech Logitech-Device-Implementations of RGB.NET Logitech-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj b/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj index d305ca0..920e6d9 100644 --- a/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj +++ b/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Msi Msi-Device-Implementations of RGB.NET Msi-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj b/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj index 9ba1267..ab7dafb 100644 --- a/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj +++ b/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Novation Novation-Device-Implementations of RGB.NET Novation-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj b/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj index 7d0040e..c6b9e6b 100644 --- a/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj +++ b/RGB.NET.Devices.PicoPi/RGB.NET.Devices.PicoPi.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.PicoPi PicoPi-Device-Implementations of RGB.NET PicoPi-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj b/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj index 570b036..9fb3efc 100644 --- a/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj +++ b/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Razer Razer-Device-Implementations of RGB.NET Razer-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj b/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj index a37c0e1..5e425fa 100644 --- a/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj +++ b/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.SteelSeries SteelSeries-Device-Implementations of RGB.NET SteelSeries-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj b/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj index d6e0eed..2407295 100644 --- a/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj +++ b/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.WS281X WS281X-Device-Implementations of RGB.NET WS281X-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,24 +33,28 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE - + + + + + diff --git a/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj b/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj index dfabe58..8c4183a 100644 --- a/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj +++ b/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj @@ -15,11 +15,10 @@ RGB.NET.Devices.Wooting Wooting-Device-Implementations of RGB.NET Wooting-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.HID/RGB.NET.HID.csproj b/RGB.NET.HID/RGB.NET.HID.csproj index 65c0bbb..fd1b145 100644 --- a/RGB.NET.HID/RGB.NET.HID.csproj +++ b/RGB.NET.HID/RGB.NET.HID.csproj @@ -16,10 +16,9 @@ HID-Module of RGB.NET HID-Module of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals Copyright © Darth Affe 2021 - Copyright © Darth Affe 2021 - http://lib.arge.be/icon.png + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Layout/RGB.NET.Layout.csproj b/RGB.NET.Layout/RGB.NET.Layout.csproj index 118af56..c826146 100644 --- a/RGB.NET.Layout/RGB.NET.Layout.csproj +++ b/RGB.NET.Layout/RGB.NET.Layout.csproj @@ -16,10 +16,9 @@ Layout-Module of RGB.NET Layout-Module of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals Copyright © Darth Affe 2021 - Copyright © Darth Affe 2021 - http://lib.arge.be/icon.png + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/RGB.NET.Presets/RGB.NET.Presets.csproj b/RGB.NET.Presets/RGB.NET.Presets.csproj index 4740b83..3fd595a 100644 --- a/RGB.NET.Presets/RGB.NET.Presets.csproj +++ b/RGB.NET.Presets/RGB.NET.Presets.csproj @@ -15,11 +15,10 @@ RGB.NET.Presets Presets-Presets of RGB.NET Presets for RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Darth Affe 2020 - Copyright © Darth Affe 2020 - http://lib.arge.be/icon.png + Copyright © Darth Affe 2021 + icon.png https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + LGPL-2.1-only Github https://github.com/DarthAffe/RGB.NET True @@ -34,22 +33,26 @@ true True True + portable + snupkg $(DefineConstants);TRACE;DEBUG true - full false - pdbonly true $(NoWarn);CS1591;CS1572;CS1573 $(DefineConstants);RELEASE + + + + diff --git a/Resources/icon.png b/Resources/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..484098a02630ba2399accee9d87e226d3123916b GIT binary patch literal 21096 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 literal 0 HcmV?d00001 diff --git a/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj b/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj index 2608e84..0027b10 100644 --- a/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj +++ b/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj @@ -7,9 +7,9 @@ - - - + + +