From 59e0344c688d7e88ac8db391dd7d6412736ba923 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 13 May 2017 08:17:01 +0200 Subject: [PATCH] Refactoring --- RGB.NET.Core/Devices/AbstractRGBDevice.cs | 6 +-- .../Helper/CultureHelper.cs | 6 +-- .../Helper/PathHelper.cs | 13 ++++-- RGB.NET.Core/Leds/Color.cs | 30 ++++++------- RGB.NET.Core/Leds/Led.cs | 16 +++---- RGB.NET.Core/Positioning/Point.cs | 8 ++-- RGB.NET.Core/Positioning/Rectangle.cs | 18 ++++---- RGB.NET.Core/Positioning/Size.cs | 8 ++-- RGB.NET.Core/RGB.NET.Core.csproj | 2 + RGB.NET.Core/RGB.NET.Core.csproj.DotSettings | 1 + RGB.NET.Core/RGBSurfaceUpdater.cs | 9 ++-- .../Helper/CultureHelper.cs | 44 ------------------- .../Helper/PathHelper.cs | 24 ---------- .../Keyboard/CoolerMasterKeyboardRGBDevice.cs | 1 - .../CoolerMasterKeyboardRGBDeviceInfo.cs | 1 - .../RGB.NET.Devices.CoolerMaster.csproj | 2 - .../Headset/CorsairHeadsetRGBDevice.cs | 1 - .../Headset/CorsairHeadsetRGBDeviceInfo.cs | 4 +- RGB.NET.Devices.Corsair/Helper/PathHelper.cs | 24 ---------- .../Keyboard/CorsairKeyboardRGBDevice.cs | 1 - .../Keyboard/CorsairKeyboardRGBDeviceInfo.cs | 4 +- .../Mouse/CorsairMouseRGBDevice.cs | 1 - .../Mouse/CorsairMouseRGBDeviceInfo.cs | 4 +- .../Mousmat/CorsairMousematRGBDevice.cs | 1 - .../Mousmat/CorsairMousematRGBDeviceInfo.cs | 4 +- .../RGB.NET.Devices.Corsair.csproj | 1 - .../Keyboard/LogitechKeyboardRGBDevice.cs | 3 +- .../Properties/AssemblyInfo.cs | 7 ++- .../RGB.NET.Devices.Logitech.csproj | 2 - RGB.NET.Groups/Groups/RectangleLedGroup.cs | 4 +- RGB.NET.WPF/Controls/LedVisualizer.cs | 4 +- RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs | 4 +- 32 files changed, 82 insertions(+), 176 deletions(-) rename {RGB.NET.Devices.Logitech => RGB.NET.Core}/Helper/CultureHelper.cs (87%) rename {RGB.NET.Devices.Logitech => RGB.NET.Core}/Helper/PathHelper.cs (64%) delete mode 100644 RGB.NET.Devices.CoolerMaster/Helper/CultureHelper.cs delete mode 100644 RGB.NET.Devices.CoolerMaster/Helper/PathHelper.cs delete mode 100644 RGB.NET.Devices.Corsair/Helper/PathHelper.cs diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs index 7d3ac1d..4491ba4 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs @@ -26,7 +26,7 @@ namespace RGB.NET.Core /// protected Size InternalSize { - get { return _internalSize; } + get => _internalSize; set { // ReSharper disable once ExplicitCallerInfoArgument @@ -39,8 +39,8 @@ namespace RGB.NET.Core /// public Point Location { - get { return _location; } - set { SetProperty(ref _location, value ?? new Point()); } + get => _location; + set => SetProperty(ref _location, value ?? new Point()); } /// diff --git a/RGB.NET.Devices.Logitech/Helper/CultureHelper.cs b/RGB.NET.Core/Helper/CultureHelper.cs similarity index 87% rename from RGB.NET.Devices.Logitech/Helper/CultureHelper.cs rename to RGB.NET.Core/Helper/CultureHelper.cs index d1bb98f..3ea900a 100644 --- a/RGB.NET.Devices.Logitech/Helper/CultureHelper.cs +++ b/RGB.NET.Core/Helper/CultureHelper.cs @@ -2,12 +2,12 @@ using System.Globalization; using System.Runtime.InteropServices; -namespace RGB.NET.Devices.Logitech +namespace RGB.NET.Core { /// /// Offers some helper-methods for culture related things. /// - internal static class CultureHelper + public static class CultureHelper { #region DLLImports @@ -26,7 +26,7 @@ namespace RGB.NET.Devices.Logitech /// Gets the current keyboard-layout from the OS. /// /// The current keyboard-layout - internal static CultureInfo GetCurrentCulture() + public static CultureInfo GetCurrentCulture() { try { diff --git a/RGB.NET.Devices.Logitech/Helper/PathHelper.cs b/RGB.NET.Core/Helper/PathHelper.cs similarity index 64% rename from RGB.NET.Devices.Logitech/Helper/PathHelper.cs rename to RGB.NET.Core/Helper/PathHelper.cs index 80acac3..dc43f25 100644 --- a/RGB.NET.Devices.Logitech/Helper/PathHelper.cs +++ b/RGB.NET.Core/Helper/PathHelper.cs @@ -1,24 +1,29 @@ using System.IO; using System.Reflection; -namespace RGB.NET.Devices.Logitech +namespace RGB.NET.Core { /// /// Offers some helper-methods for file-path related things. /// - internal static class PathHelper + public static class PathHelper { + #region Methods + /// /// Returns an absolute path created from an relative path relatvie to the location of the executung assembly. /// /// The relative path to convert. /// The absolute path. - internal static string GetAbsolutePath(string relativePath) + public static string GetAbsolutePath(string relativePath) { string assemblyLocation = Assembly.GetEntryAssembly()?.Location; if (assemblyLocation == null) return relativePath; - return Path.Combine(Path.GetDirectoryName(assemblyLocation), relativePath); + string directoryName = Path.GetDirectoryName(assemblyLocation); + return directoryName == null ? null : Path.Combine(directoryName, relativePath); } + + #endregion } } diff --git a/RGB.NET.Core/Leds/Color.cs b/RGB.NET.Core/Leds/Color.cs index 96ab789..67795c8 100644 --- a/RGB.NET.Core/Leds/Color.cs +++ b/RGB.NET.Core/Leds/Color.cs @@ -31,7 +31,7 @@ namespace RGB.NET.Core /// public byte A { - get { return _a; } + get => _a; set { if (SetProperty(ref _a, value)) @@ -45,8 +45,8 @@ namespace RGB.NET.Core /// public double APercent { - get { return A / (double)byte.MaxValue; } - set { A = GetByteValueFromPercentage(value); } + get => A / (double)byte.MaxValue; + set => A = GetByteValueFromPercentage(value); } private byte _r; @@ -55,7 +55,7 @@ namespace RGB.NET.Core /// public byte R { - get { return _r; } + get => _r; set { if (SetProperty(ref _r, value)) @@ -72,8 +72,8 @@ namespace RGB.NET.Core /// public double RPercent { - get { return R / (double)byte.MaxValue; } - set { R = GetByteValueFromPercentage(value); } + get => R / (double)byte.MaxValue; + set => R = GetByteValueFromPercentage(value); } private byte _g; @@ -82,7 +82,7 @@ namespace RGB.NET.Core /// public byte G { - get { return _g; } + get => _g; set { if (SetProperty(ref _g, value)) @@ -100,8 +100,8 @@ namespace RGB.NET.Core /// public double GPercent { - get { return G / (double)byte.MaxValue; } - set { G = GetByteValueFromPercentage(value); } + get => G / (double)byte.MaxValue; + set => G = GetByteValueFromPercentage(value); } private byte _b; @@ -110,7 +110,7 @@ namespace RGB.NET.Core /// public byte B { - get { return _b; } + get => _b; set { if (SetProperty(ref _b, value)) @@ -128,8 +128,8 @@ namespace RGB.NET.Core /// public double BPercent { - get { return B / (double)byte.MaxValue; } - set { B = GetByteValueFromPercentage(value); } + get => B / (double)byte.MaxValue; + set => B = GetByteValueFromPercentage(value); } #endregion @@ -142,7 +142,7 @@ namespace RGB.NET.Core /// public double Hue { - get { return _hue ?? (_hue = CaclulateHueFromRGB()).Value; } + get => _hue ?? (_hue = CaclulateHueFromRGB()).Value; set { if (SetProperty(ref _hue, value)) @@ -156,7 +156,7 @@ namespace RGB.NET.Core /// public double Saturation { - get { return _saturation ?? (_saturation = CaclulateSaturationFromRGB()).Value; } + get => _saturation ?? (_saturation = CaclulateSaturationFromRGB()).Value; set { if (SetProperty(ref _saturation, value)) @@ -170,7 +170,7 @@ namespace RGB.NET.Core /// public double Value { - get { return _value ?? (_value = CaclulateValueFromRGB()).Value; } + get => _value ?? (_value = CaclulateValueFromRGB()).Value; set { if (SetProperty(ref _value, value)) diff --git a/RGB.NET.Core/Leds/Led.cs b/RGB.NET.Core/Leds/Led.cs index 79c4681..679f08e 100644 --- a/RGB.NET.Core/Leds/Led.cs +++ b/RGB.NET.Core/Leds/Led.cs @@ -29,8 +29,8 @@ namespace RGB.NET.Core /// public Shape Shape { - get { return _shape; } - set { SetProperty(ref _shape, value); } + get => _shape; + set => SetProperty(ref _shape, value); } private string _shapeData; @@ -39,8 +39,8 @@ namespace RGB.NET.Core /// public string ShapeData { - get { return _shapeData; } - set { SetProperty(ref _shapeData, value); } + get => _shapeData; + set => SetProperty(ref _shapeData, value); } /// @@ -59,7 +59,7 @@ namespace RGB.NET.Core /// public Color RequestedColor { - get { return new Color(_requestedColor); } + get => new Color(_requestedColor); private set { SetProperty(ref _requestedColor, value); @@ -75,7 +75,7 @@ namespace RGB.NET.Core /// public Color Color { - get { return _color; } + get => _color; set { if (!IsLocked) @@ -97,8 +97,8 @@ namespace RGB.NET.Core /// public bool IsLocked { - get { return _isLocked; } - set { SetProperty(ref _isLocked, value); } + get => _isLocked; + set => SetProperty(ref _isLocked, value); } /// diff --git a/RGB.NET.Core/Positioning/Point.cs b/RGB.NET.Core/Positioning/Point.cs index b137060..caa2d88 100644 --- a/RGB.NET.Core/Positioning/Point.cs +++ b/RGB.NET.Core/Positioning/Point.cs @@ -19,8 +19,8 @@ namespace RGB.NET.Core /// public double X { - get { return _x; } - set { SetProperty(ref _x, value); } + get => _x; + set => SetProperty(ref _x, value); } private double _y; @@ -29,8 +29,8 @@ namespace RGB.NET.Core /// public double Y { - get { return _y; } - set { SetProperty(ref _y, value); } + get => _y; + set => SetProperty(ref _y, value); } #endregion diff --git a/RGB.NET.Core/Positioning/Rectangle.cs b/RGB.NET.Core/Positioning/Rectangle.cs index 62be5d1..b15b069 100644 --- a/RGB.NET.Core/Positioning/Rectangle.cs +++ b/RGB.NET.Core/Positioning/Rectangle.cs @@ -22,7 +22,7 @@ namespace RGB.NET.Core /// public Point Location { - get { return _location; } + get => _location; set { if (SetProperty(ref _location, value)) @@ -37,7 +37,7 @@ namespace RGB.NET.Core /// public Size Size { - get { return _size; } + get => _size; set { if (SetProperty(ref _size, value)) @@ -152,13 +152,13 @@ namespace RGB.NET.Core if (points != null) foreach (Point point in points) - { - hasPoint = true; - posX = Math.Min(posX, point.X); - posY = Math.Min(posY, point.Y); - posX2 = Math.Max(posX2, point.X); - posY2 = Math.Max(posY2, point.Y); - } + { + hasPoint = true; + posX = Math.Min(posX, point.X); + posY = Math.Min(posY, point.Y); + posX2 = Math.Max(posX2, point.X); + posY2 = Math.Max(posY2, point.Y); + } if (hasPoint) InitializeFromPoints(new Point(posX, posY), new Point(posX2, posY2)); diff --git a/RGB.NET.Core/Positioning/Size.cs b/RGB.NET.Core/Positioning/Size.cs index 39abcb4..4b7a33c 100644 --- a/RGB.NET.Core/Positioning/Size.cs +++ b/RGB.NET.Core/Positioning/Size.cs @@ -19,8 +19,8 @@ namespace RGB.NET.Core /// public double Width { - get { return _width; } - set { SetProperty(ref _width, value); } + get => _width; + set => SetProperty(ref _width, value); } private double _height; @@ -29,8 +29,8 @@ namespace RGB.NET.Core /// public double Height { - get { return _height; } - set { SetProperty(ref _height, value); } + get => _height; + set => SetProperty(ref _height, value); } #endregion diff --git a/RGB.NET.Core/RGB.NET.Core.csproj b/RGB.NET.Core/RGB.NET.Core.csproj index 39e3b6f..3f9131f 100644 --- a/RGB.NET.Core/RGB.NET.Core.csproj +++ b/RGB.NET.Core/RGB.NET.Core.csproj @@ -51,6 +51,8 @@ + + diff --git a/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings b/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings index 4c65387..80ebec2 100644 --- a/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings +++ b/RGB.NET.Core/RGB.NET.Core.csproj.DotSettings @@ -6,6 +6,7 @@ True True True + True True True True diff --git a/RGB.NET.Core/RGBSurfaceUpdater.cs b/RGB.NET.Core/RGBSurfaceUpdater.cs index 253921d..270e571 100644 --- a/RGB.NET.Core/RGBSurfaceUpdater.cs +++ b/RGB.NET.Core/RGBSurfaceUpdater.cs @@ -12,14 +12,16 @@ namespace RGB.NET.Core private CancellationToken _updateToken; private Task _updateTask; + // ReSharper disable MemberCanBePrivate.Global + private double _updateFrequency = 1.0 / 30.0; /// /// Gets or sets the update-frequency in seconds. (Calculate by using '1.0 / updates per second') /// public double UpdateFrequency { - get { return _updateFrequency; } - set { SetProperty(ref _updateFrequency, value); } + get => _updateFrequency; + set => SetProperty(ref _updateFrequency, value); } private UpdateMode _updateMode = UpdateMode.Manual; @@ -28,7 +30,7 @@ namespace RGB.NET.Core /// public UpdateMode UpdateMode { - get { return _updateMode; } + get => _updateMode; set { if (SetProperty(ref _updateMode, value)) @@ -36,6 +38,7 @@ namespace RGB.NET.Core } } + // ReSharper restore MemberCanBePrivate.Global #endregion #region Methods diff --git a/RGB.NET.Devices.CoolerMaster/Helper/CultureHelper.cs b/RGB.NET.Devices.CoolerMaster/Helper/CultureHelper.cs deleted file mode 100644 index cd0bb4f..0000000 --- a/RGB.NET.Devices.CoolerMaster/Helper/CultureHelper.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Globalization; -using System.Runtime.InteropServices; - -namespace RGB.NET.Devices.CoolerMaster.Helper -{ - /// - /// Offers some helper-methods for culture related things. - /// - internal static class CultureHelper - { - #region DLLImports - - [DllImport("user32.dll")] - private static extern IntPtr GetKeyboardLayout(uint thread); - - #endregion - - #region Constructors - - #endregion - - #region Methods - - /// - /// Gets the current keyboard-layout from the OS. - /// - /// The current keyboard-layout - internal static CultureInfo GetCurrentCulture() - { - try - { - int keyboardLayout = GetKeyboardLayout(0).ToInt32() & 0xFFFF; - return new CultureInfo(keyboardLayout); - } - catch - { - return new CultureInfo(1033); // en-US on error. - } - } - - #endregion - } -} diff --git a/RGB.NET.Devices.CoolerMaster/Helper/PathHelper.cs b/RGB.NET.Devices.CoolerMaster/Helper/PathHelper.cs deleted file mode 100644 index 213ab67..0000000 --- a/RGB.NET.Devices.CoolerMaster/Helper/PathHelper.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.IO; -using System.Reflection; - -namespace RGB.NET.Devices.CoolerMaster.Helper -{ - /// - /// Offers some helper-methods for file-path related things. - /// - internal static class PathHelper - { - /// - /// Returns an absolute path created from an relative path relatvie to the location of the executung assembly. - /// - /// The relative path to convert. - /// The absolute path. - internal static string GetAbsolutePath(string relativePath) - { - string assemblyLocation = Assembly.GetEntryAssembly()?.Location; - if (assemblyLocation == null) return relativePath; - - return Path.Combine(Path.GetDirectoryName(assemblyLocation), relativePath); - } - } -} diff --git a/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs b/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs index 9c4cd19..7ad5454 100644 --- a/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDevice.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using RGB.NET.Core; -using RGB.NET.Devices.CoolerMaster.Helper; namespace RGB.NET.Devices.CoolerMaster { diff --git a/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDeviceInfo.cs b/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDeviceInfo.cs index f84e497..f11bb88 100644 --- a/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDeviceInfo.cs +++ b/RGB.NET.Devices.CoolerMaster/Keyboard/CoolerMasterKeyboardRGBDeviceInfo.cs @@ -1,7 +1,6 @@ using System; using System.Globalization; using RGB.NET.Core; -using RGB.NET.Devices.CoolerMaster.Helper; namespace RGB.NET.Devices.CoolerMaster { diff --git a/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj b/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj index ef465a0..07a95b2 100644 --- a/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj +++ b/RGB.NET.Devices.CoolerMaster/RGB.NET.Devices.CoolerMaster.csproj @@ -57,9 +57,7 @@ - - diff --git a/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs b/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs index e604c3f..274ce23 100644 --- a/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDevice.cs @@ -2,7 +2,6 @@ // ReSharper disable UnusedMember.Global using RGB.NET.Core; -using RGB.NET.Devices.Corsair.Helper; namespace RGB.NET.Devices.Corsair { diff --git a/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDeviceInfo.cs index 6925728..cbcb56b 100644 --- a/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Headset/CorsairHeadsetRGBDeviceInfo.cs @@ -1,5 +1,5 @@ using System; -using RGB.NET.Devices.Corsair.Helper; +using RGB.NET.Core; using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair @@ -17,7 +17,7 @@ namespace RGB.NET.Devices.Corsair /// The index of the . /// The native -struct internal CorsairHeadsetRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) - : base(deviceIndex, Core.RGBDeviceType.Headset, nativeInfo) + : base(deviceIndex, RGBDeviceType.Headset, nativeInfo) { Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Headsets\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute); } diff --git a/RGB.NET.Devices.Corsair/Helper/PathHelper.cs b/RGB.NET.Devices.Corsair/Helper/PathHelper.cs deleted file mode 100644 index e0f414a..0000000 --- a/RGB.NET.Devices.Corsair/Helper/PathHelper.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.IO; -using System.Reflection; - -namespace RGB.NET.Devices.Corsair.Helper -{ - /// - /// Offers some helper-methods for file-path related things. - /// - internal static class PathHelper - { - /// - /// Returns an absolute path created from an relative path relatvie to the location of the executung assembly. - /// - /// The relative path to convert. - /// The absolute path. - internal static string GetAbsolutePath(string relativePath) - { - string assemblyLocation = Assembly.GetEntryAssembly()?.Location; - if (assemblyLocation == null) return relativePath; - - return Path.Combine(Path.GetDirectoryName(assemblyLocation), relativePath); - } - } -} diff --git a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs index 71d82e5..36c0f06 100644 --- a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDevice.cs @@ -4,7 +4,6 @@ using System; using System.Runtime.InteropServices; using RGB.NET.Core; -using RGB.NET.Devices.Corsair.Helper; using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair diff --git a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDeviceInfo.cs index 24b6ef0..f5ad4a5 100644 --- a/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Keyboard/CorsairKeyboardRGBDeviceInfo.cs @@ -2,7 +2,7 @@ // ReSharper disable UnusedMember.Global using System; -using RGB.NET.Devices.Corsair.Helper; +using RGB.NET.Core; using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair @@ -34,7 +34,7 @@ namespace RGB.NET.Devices.Corsair /// The index of the . /// The native -struct internal CorsairKeyboardRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) - : base(deviceIndex, Core.RGBDeviceType.Keyboard, nativeInfo) + : base(deviceIndex, RGBDeviceType.Keyboard, nativeInfo) { this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout; this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout; diff --git a/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs b/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs index 01a72cc..1e3fa34 100644 --- a/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDevice.cs @@ -3,7 +3,6 @@ using RGB.NET.Core; using RGB.NET.Core.Exceptions; -using RGB.NET.Devices.Corsair.Helper; namespace RGB.NET.Devices.Corsair { diff --git a/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDeviceInfo.cs index e84964a..8d614fc 100644 --- a/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Mouse/CorsairMouseRGBDeviceInfo.cs @@ -1,5 +1,5 @@ using System; -using RGB.NET.Devices.Corsair.Helper; +using RGB.NET.Core; using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair @@ -26,7 +26,7 @@ namespace RGB.NET.Devices.Corsair /// The index of the . /// The native -struct internal CorsairMouseRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) - : base(deviceIndex, Core.RGBDeviceType.Mouse, nativeInfo) + : base(deviceIndex, RGBDeviceType.Mouse, nativeInfo) { this.PhysicalLayout = (CorsairPhysicalMouseLayout)nativeInfo.physicalLayout; diff --git a/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDevice.cs b/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDevice.cs index 6f00342..e280293 100644 --- a/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDevice.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using RGB.NET.Core; -using RGB.NET.Devices.Corsair.Helper; using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair diff --git a/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDeviceInfo.cs index b78e2ad..fd5463b 100644 --- a/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Mousmat/CorsairMousematRGBDeviceInfo.cs @@ -1,5 +1,5 @@ using System; -using RGB.NET.Devices.Corsair.Helper; +using RGB.NET.Core; using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair @@ -17,7 +17,7 @@ namespace RGB.NET.Devices.Corsair /// The index if the . /// The native -struct internal CorsairMousematRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) - : base(deviceIndex, Core.RGBDeviceType.Mousemat, nativeInfo) + : base(deviceIndex, RGBDeviceType.Mousemat, nativeInfo) { Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Mousemat\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute); } diff --git a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj index 25fe7b1..23f8a2e 100644 --- a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj +++ b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj @@ -62,7 +62,6 @@ - diff --git a/RGB.NET.Devices.Logitech/Keyboard/LogitechKeyboardRGBDevice.cs b/RGB.NET.Devices.Logitech/Keyboard/LogitechKeyboardRGBDevice.cs index cdb5261..b3b5614 100644 --- a/RGB.NET.Devices.Logitech/Keyboard/LogitechKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Logitech/Keyboard/LogitechKeyboardRGBDevice.cs @@ -1,8 +1,7 @@ // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedMember.Global -using System.IO; -using System.Reflection; +using RGB.NET.Core; namespace RGB.NET.Devices.Logitech { diff --git a/RGB.NET.Devices.Logitech/Properties/AssemblyInfo.cs b/RGB.NET.Devices.Logitech/Properties/AssemblyInfo.cs index d3238fd..7a27ec7 100644 --- a/RGB.NET.Devices.Logitech/Properties/AssemblyInfo.cs +++ b/RGB.NET.Devices.Logitech/Properties/AssemblyInfo.cs @@ -1,16 +1,15 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("RGB.NET.Devices.Logitech")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Logitech-Device-Implementations of RGB.NET")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("Wyrez")] [assembly: AssemblyProduct("RGB.NET.Devices.Logitech")] -[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyCopyright("Copyright © Wyrez 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj b/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj index 3eebc0a..4668062 100644 --- a/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj +++ b/RGB.NET.Devices.Logitech/RGB.NET.Devices.Logitech.csproj @@ -58,8 +58,6 @@ - - diff --git a/RGB.NET.Groups/Groups/RectangleLedGroup.cs b/RGB.NET.Groups/Groups/RectangleLedGroup.cs index a53e741..c8b9f5d 100644 --- a/RGB.NET.Groups/Groups/RectangleLedGroup.cs +++ b/RGB.NET.Groups/Groups/RectangleLedGroup.cs @@ -23,7 +23,7 @@ namespace RGB.NET.Groups /// public Rectangle Rectangle { - get { return _rectangle; } + get => _rectangle; set { _rectangle = value; @@ -37,7 +37,7 @@ namespace RGB.NET.Groups /// public double MinOverlayPercentage { - get { return _minOverlayPercentage; } + get => _minOverlayPercentage; set { _minOverlayPercentage = value; diff --git a/RGB.NET.WPF/Controls/LedVisualizer.cs b/RGB.NET.WPF/Controls/LedVisualizer.cs index 82f2742..8c9a425 100644 --- a/RGB.NET.WPF/Controls/LedVisualizer.cs +++ b/RGB.NET.WPF/Controls/LedVisualizer.cs @@ -23,8 +23,8 @@ namespace RGB.NET.WPF.Controls /// public Led Led { - get { return (Led)GetValue(LedProperty); } - set { SetValue(LedProperty, value); } + get => (Led)GetValue(LedProperty); + set => SetValue(LedProperty, value); } // ReSharper restore InconsistentNaming diff --git a/RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs b/RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs index ad7500c..590fb02 100644 --- a/RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs +++ b/RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs @@ -36,8 +36,8 @@ namespace RGB.NET.WPF.Controls /// public IRGBDevice Device { - get { return (IRGBDevice)GetValue(DeviceProperty); } - set { SetValue(DeviceProperty, value); } + get => (IRGBDevice)GetValue(DeviceProperty); + set => SetValue(DeviceProperty, value); } // ReSharper restore InconsistentNaming