1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Refactoring

This commit is contained in:
Darth Affe 2017-05-13 08:17:01 +02:00
parent 7264731eb1
commit 59e0344c68
32 changed files with 82 additions and 176 deletions

View File

@ -26,7 +26,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
protected Size InternalSize protected Size InternalSize
{ {
get { return _internalSize; } get => _internalSize;
set set
{ {
// ReSharper disable once ExplicitCallerInfoArgument // ReSharper disable once ExplicitCallerInfoArgument
@ -39,8 +39,8 @@ namespace RGB.NET.Core
/// <inheritdoc /> /// <inheritdoc />
public Point Location public Point Location
{ {
get { return _location; } get => _location;
set { SetProperty(ref _location, value ?? new Point()); } set => SetProperty(ref _location, value ?? new Point());
} }
/// <summary> /// <summary>

View File

@ -2,12 +2,12 @@
using System.Globalization; using System.Globalization;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace RGB.NET.Devices.Logitech namespace RGB.NET.Core
{ {
/// <summary> /// <summary>
/// Offers some helper-methods for culture related things. /// Offers some helper-methods for culture related things.
/// </summary> /// </summary>
internal static class CultureHelper public static class CultureHelper
{ {
#region DLLImports #region DLLImports
@ -26,7 +26,7 @@ namespace RGB.NET.Devices.Logitech
/// Gets the current keyboard-layout from the OS. /// Gets the current keyboard-layout from the OS.
/// </summary> /// </summary>
/// <returns>The current keyboard-layout</returns> /// <returns>The current keyboard-layout</returns>
internal static CultureInfo GetCurrentCulture() public static CultureInfo GetCurrentCulture()
{ {
try try
{ {

View File

@ -1,24 +1,29 @@
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
namespace RGB.NET.Devices.Logitech namespace RGB.NET.Core
{ {
/// <summary> /// <summary>
/// Offers some helper-methods for file-path related things. /// Offers some helper-methods for file-path related things.
/// </summary> /// </summary>
internal static class PathHelper public static class PathHelper
{ {
#region Methods
/// <summary> /// <summary>
/// Returns an absolute path created from an relative path relatvie to the location of the executung assembly. /// Returns an absolute path created from an relative path relatvie to the location of the executung assembly.
/// </summary> /// </summary>
/// <param name="relativePath">The relative path to convert.</param> /// <param name="relativePath">The relative path to convert.</param>
/// <returns>The absolute path.</returns> /// <returns>The absolute path.</returns>
internal static string GetAbsolutePath(string relativePath) public static string GetAbsolutePath(string relativePath)
{ {
string assemblyLocation = Assembly.GetEntryAssembly()?.Location; string assemblyLocation = Assembly.GetEntryAssembly()?.Location;
if (assemblyLocation == null) return relativePath; 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
} }
} }

View File

@ -31,7 +31,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public byte A public byte A
{ {
get { return _a; } get => _a;
set set
{ {
if (SetProperty(ref _a, value)) if (SetProperty(ref _a, value))
@ -45,8 +45,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double APercent public double APercent
{ {
get { return A / (double)byte.MaxValue; } get => A / (double)byte.MaxValue;
set { A = GetByteValueFromPercentage(value); } set => A = GetByteValueFromPercentage(value);
} }
private byte _r; private byte _r;
@ -55,7 +55,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public byte R public byte R
{ {
get { return _r; } get => _r;
set set
{ {
if (SetProperty(ref _r, value)) if (SetProperty(ref _r, value))
@ -72,8 +72,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double RPercent public double RPercent
{ {
get { return R / (double)byte.MaxValue; } get => R / (double)byte.MaxValue;
set { R = GetByteValueFromPercentage(value); } set => R = GetByteValueFromPercentage(value);
} }
private byte _g; private byte _g;
@ -82,7 +82,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public byte G public byte G
{ {
get { return _g; } get => _g;
set set
{ {
if (SetProperty(ref _g, value)) if (SetProperty(ref _g, value))
@ -100,8 +100,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double GPercent public double GPercent
{ {
get { return G / (double)byte.MaxValue; } get => G / (double)byte.MaxValue;
set { G = GetByteValueFromPercentage(value); } set => G = GetByteValueFromPercentage(value);
} }
private byte _b; private byte _b;
@ -110,7 +110,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public byte B public byte B
{ {
get { return _b; } get => _b;
set set
{ {
if (SetProperty(ref _b, value)) if (SetProperty(ref _b, value))
@ -128,8 +128,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double BPercent public double BPercent
{ {
get { return B / (double)byte.MaxValue; } get => B / (double)byte.MaxValue;
set { B = GetByteValueFromPercentage(value); } set => B = GetByteValueFromPercentage(value);
} }
#endregion #endregion
@ -142,7 +142,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double Hue public double Hue
{ {
get { return _hue ?? (_hue = CaclulateHueFromRGB()).Value; } get => _hue ?? (_hue = CaclulateHueFromRGB()).Value;
set set
{ {
if (SetProperty(ref _hue, value)) if (SetProperty(ref _hue, value))
@ -156,7 +156,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double Saturation public double Saturation
{ {
get { return _saturation ?? (_saturation = CaclulateSaturationFromRGB()).Value; } get => _saturation ?? (_saturation = CaclulateSaturationFromRGB()).Value;
set set
{ {
if (SetProperty(ref _saturation, value)) if (SetProperty(ref _saturation, value))
@ -170,7 +170,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double Value public double Value
{ {
get { return _value ?? (_value = CaclulateValueFromRGB()).Value; } get => _value ?? (_value = CaclulateValueFromRGB()).Value;
set set
{ {
if (SetProperty(ref _value, value)) if (SetProperty(ref _value, value))

View File

@ -29,8 +29,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public Shape Shape public Shape Shape
{ {
get { return _shape; } get => _shape;
set { SetProperty(ref _shape, value); } set => SetProperty(ref _shape, value);
} }
private string _shapeData; private string _shapeData;
@ -39,8 +39,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public string ShapeData public string ShapeData
{ {
get { return _shapeData; } get => _shapeData;
set { SetProperty(ref _shapeData, value); } set => SetProperty(ref _shapeData, value);
} }
/// <summary> /// <summary>
@ -59,7 +59,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public Color RequestedColor public Color RequestedColor
{ {
get { return new Color(_requestedColor); } get => new Color(_requestedColor);
private set private set
{ {
SetProperty(ref _requestedColor, value); SetProperty(ref _requestedColor, value);
@ -75,7 +75,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public Color Color public Color Color
{ {
get { return _color; } get => _color;
set set
{ {
if (!IsLocked) if (!IsLocked)
@ -97,8 +97,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public bool IsLocked public bool IsLocked
{ {
get { return _isLocked; } get => _isLocked;
set { SetProperty(ref _isLocked, value); } set => SetProperty(ref _isLocked, value);
} }
/// <summary> /// <summary>

View File

@ -19,8 +19,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double X public double X
{ {
get { return _x; } get => _x;
set { SetProperty(ref _x, value); } set => SetProperty(ref _x, value);
} }
private double _y; private double _y;
@ -29,8 +29,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double Y public double Y
{ {
get { return _y; } get => _y;
set { SetProperty(ref _y, value); } set => SetProperty(ref _y, value);
} }
#endregion #endregion

View File

@ -22,7 +22,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public Point Location public Point Location
{ {
get { return _location; } get => _location;
set set
{ {
if (SetProperty(ref _location, value)) if (SetProperty(ref _location, value))
@ -37,7 +37,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public Size Size public Size Size
{ {
get { return _size; } get => _size;
set set
{ {
if (SetProperty(ref _size, value)) if (SetProperty(ref _size, value))

View File

@ -19,8 +19,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double Width public double Width
{ {
get { return _width; } get => _width;
set { SetProperty(ref _width, value); } set => SetProperty(ref _width, value);
} }
private double _height; private double _height;
@ -29,8 +29,8 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public double Height public double Height
{ {
get { return _height; } get => _height;
set { SetProperty(ref _height, value); } set => SetProperty(ref _height, value);
} }
#endregion #endregion

View File

@ -51,6 +51,8 @@
<Compile Include="Devices\Layout\LedImage.cs" /> <Compile Include="Devices\Layout\LedImage.cs" />
<Compile Include="Devices\Layout\LedImageLayout.cs" /> <Compile Include="Devices\Layout\LedImageLayout.cs" />
<Compile Include="Devices\RGBDeviceLighting.cs" /> <Compile Include="Devices\RGBDeviceLighting.cs" />
<Compile Include="Helper\CultureHelper.cs" />
<Compile Include="Helper\PathHelper.cs" />
<Compile Include="Positioning\Shape.cs" /> <Compile Include="Positioning\Shape.cs" />
<Compile Include="Devices\Layout\LedLayout.cs" /> <Compile Include="Devices\Layout\LedLayout.cs" />
<Compile Include="Devices\Layout\DeviceLayout.cs" /> <Compile Include="Devices\Layout\DeviceLayout.cs" />

View File

@ -6,6 +6,7 @@
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=events/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=events/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=groups/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=groups/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=helper/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=leds/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=leds/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mvvm/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mvvm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=positioning/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=positioning/@EntryIndexedValue">True</s:Boolean>

View File

@ -12,14 +12,16 @@ namespace RGB.NET.Core
private CancellationToken _updateToken; private CancellationToken _updateToken;
private Task _updateTask; private Task _updateTask;
// ReSharper disable MemberCanBePrivate.Global
private double _updateFrequency = 1.0 / 30.0; private double _updateFrequency = 1.0 / 30.0;
/// <summary> /// <summary>
/// Gets or sets the update-frequency in seconds. (Calculate by using '1.0 / updates per second') /// Gets or sets the update-frequency in seconds. (Calculate by using '1.0 / updates per second')
/// </summary> /// </summary>
public double UpdateFrequency public double UpdateFrequency
{ {
get { return _updateFrequency; } get => _updateFrequency;
set { SetProperty(ref _updateFrequency, value); } set => SetProperty(ref _updateFrequency, value);
} }
private UpdateMode _updateMode = UpdateMode.Manual; private UpdateMode _updateMode = UpdateMode.Manual;
@ -28,7 +30,7 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
public UpdateMode UpdateMode public UpdateMode UpdateMode
{ {
get { return _updateMode; } get => _updateMode;
set set
{ {
if (SetProperty(ref _updateMode, value)) if (SetProperty(ref _updateMode, value))
@ -36,6 +38,7 @@ namespace RGB.NET.Core
} }
} }
// ReSharper restore MemberCanBePrivate.Global
#endregion #endregion
#region Methods #region Methods

View File

@ -1,44 +0,0 @@
using System;
using System.Globalization;
using System.Runtime.InteropServices;
namespace RGB.NET.Devices.CoolerMaster.Helper
{
/// <summary>
/// Offers some helper-methods for culture related things.
/// </summary>
internal static class CultureHelper
{
#region DLLImports
[DllImport("user32.dll")]
private static extern IntPtr GetKeyboardLayout(uint thread);
#endregion
#region Constructors
#endregion
#region Methods
/// <summary>
/// Gets the current keyboard-layout from the OS.
/// </summary>
/// <returns>The current keyboard-layout</returns>
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
}
}

View File

@ -1,24 +0,0 @@
using System.IO;
using System.Reflection;
namespace RGB.NET.Devices.CoolerMaster.Helper
{
/// <summary>
/// Offers some helper-methods for file-path related things.
/// </summary>
internal static class PathHelper
{
/// <summary>
/// Returns an absolute path created from an relative path relatvie to the location of the executung assembly.
/// </summary>
/// <param name="relativePath">The relative path to convert.</param>
/// <returns>The absolute path.</returns>
internal static string GetAbsolutePath(string relativePath)
{
string assemblyLocation = Assembly.GetEntryAssembly()?.Location;
if (assemblyLocation == null) return relativePath;
return Path.Combine(Path.GetDirectoryName(assemblyLocation), relativePath);
}
}
}

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.CoolerMaster.Helper;
namespace RGB.NET.Devices.CoolerMaster namespace RGB.NET.Devices.CoolerMaster
{ {

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Globalization; using System.Globalization;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.CoolerMaster.Helper;
namespace RGB.NET.Devices.CoolerMaster namespace RGB.NET.Devices.CoolerMaster
{ {

View File

@ -57,9 +57,7 @@
<Compile Include="Generic\CoolerMasterLedId.cs" /> <Compile Include="Generic\CoolerMasterLedId.cs" />
<Compile Include="Generic\CoolerMasterRGBDevice.cs" /> <Compile Include="Generic\CoolerMasterRGBDevice.cs" />
<Compile Include="Generic\CoolerMasterRGBDeviceInfo.cs" /> <Compile Include="Generic\CoolerMasterRGBDeviceInfo.cs" />
<Compile Include="Helper\CultureHelper.cs" />
<Compile Include="Helper\EnumExtension.cs" /> <Compile Include="Helper\EnumExtension.cs" />
<Compile Include="Helper\PathHelper.cs" />
<Compile Include="Keyboard\CoolerMasterKeyboardRGBDevice.cs" /> <Compile Include="Keyboard\CoolerMasterKeyboardRGBDevice.cs" />
<Compile Include="Keyboard\CoolerMasterKeyboardRGBDeviceInfo.cs" /> <Compile Include="Keyboard\CoolerMasterKeyboardRGBDeviceInfo.cs" />
<Compile Include="Keyboard\CoolerMasterKeyboardLedMappings.cs" /> <Compile Include="Keyboard\CoolerMasterKeyboardLedMappings.cs" />

View File

@ -2,7 +2,6 @@
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Helper;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair
{ {

View File

@ -1,5 +1,5 @@
using System; using System;
using RGB.NET.Devices.Corsair.Helper; using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native; using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair
@ -17,7 +17,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="deviceIndex">The index of the <see cref="CorsairHeadsetRGBDevice"/>.</param> /// <param name="deviceIndex">The index of the <see cref="CorsairHeadsetRGBDevice"/>.</param>
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param> /// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
internal CorsairHeadsetRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) 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); Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Headsets\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
} }

View File

@ -1,24 +0,0 @@
using System.IO;
using System.Reflection;
namespace RGB.NET.Devices.Corsair.Helper
{
/// <summary>
/// Offers some helper-methods for file-path related things.
/// </summary>
internal static class PathHelper
{
/// <summary>
/// Returns an absolute path created from an relative path relatvie to the location of the executung assembly.
/// </summary>
/// <param name="relativePath">The relative path to convert.</param>
/// <returns>The absolute path.</returns>
internal static string GetAbsolutePath(string relativePath)
{
string assemblyLocation = Assembly.GetEntryAssembly()?.Location;
if (assemblyLocation == null) return relativePath;
return Path.Combine(Path.GetDirectoryName(assemblyLocation), relativePath);
}
}
}

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Helper;
using RGB.NET.Devices.Corsair.Native; using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair

View File

@ -2,7 +2,7 @@
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
using System; using System;
using RGB.NET.Devices.Corsair.Helper; using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native; using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair
@ -34,7 +34,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="deviceIndex">The index of the <see cref="CorsairKeyboardRGBDevice"/>.</param> /// <param name="deviceIndex">The index of the <see cref="CorsairKeyboardRGBDevice"/>.</param>
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param> /// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
internal CorsairKeyboardRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) internal CorsairKeyboardRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
: base(deviceIndex, Core.RGBDeviceType.Keyboard, nativeInfo) : base(deviceIndex, RGBDeviceType.Keyboard, nativeInfo)
{ {
this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout; this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout;
this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout; this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout;

View File

@ -3,7 +3,6 @@
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Core.Exceptions; using RGB.NET.Core.Exceptions;
using RGB.NET.Devices.Corsair.Helper;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair
{ {

View File

@ -1,5 +1,5 @@
using System; using System;
using RGB.NET.Devices.Corsair.Helper; using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native; using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair
@ -26,7 +26,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="deviceIndex">The index of the <see cref="CorsairMouseRGBDevice"/>.</param> /// <param name="deviceIndex">The index of the <see cref="CorsairMouseRGBDevice"/>.</param>
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param> /// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
internal CorsairMouseRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) internal CorsairMouseRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
: base(deviceIndex, Core.RGBDeviceType.Mouse, nativeInfo) : base(deviceIndex, RGBDeviceType.Mouse, nativeInfo)
{ {
this.PhysicalLayout = (CorsairPhysicalMouseLayout)nativeInfo.physicalLayout; this.PhysicalLayout = (CorsairPhysicalMouseLayout)nativeInfo.physicalLayout;

View File

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Helper;
using RGB.NET.Devices.Corsair.Native; using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair

View File

@ -1,5 +1,5 @@
using System; using System;
using RGB.NET.Devices.Corsair.Helper; using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native; using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair namespace RGB.NET.Devices.Corsair
@ -17,7 +17,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="deviceIndex">The index if the <see cref="CorsairMousematRGBDevice"/>.</param> /// <param name="deviceIndex">The index if the <see cref="CorsairMousematRGBDevice"/>.</param>
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param> /// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
internal CorsairMousematRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo) 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); Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Mousemat\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
} }

View File

@ -62,7 +62,6 @@
<Compile Include="Generic\CorsairRGBDevice.cs" /> <Compile Include="Generic\CorsairRGBDevice.cs" />
<Compile Include="Headset\CorsairHeadsetRGBDevice.cs" /> <Compile Include="Headset\CorsairHeadsetRGBDevice.cs" />
<Compile Include="Headset\CorsairHeadsetRGBDeviceInfo.cs" /> <Compile Include="Headset\CorsairHeadsetRGBDeviceInfo.cs" />
<Compile Include="Helper\PathHelper.cs" />
<Compile Include="Keyboard\CorsairKeyboardRGBDevice.cs" /> <Compile Include="Keyboard\CorsairKeyboardRGBDevice.cs" />
<Compile Include="Keyboard\CorsairKeyboardRGBDeviceInfo.cs" /> <Compile Include="Keyboard\CorsairKeyboardRGBDeviceInfo.cs" />
<Compile Include="Mouse\CorsairMouseRGBDevice.cs" /> <Compile Include="Mouse\CorsairMouseRGBDevice.cs" />

View File

@ -1,8 +1,7 @@
// ReSharper disable MemberCanBePrivate.Global // ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global // ReSharper disable UnusedMember.Global
using System.IO; using RGB.NET.Core;
using System.Reflection;
namespace RGB.NET.Devices.Logitech namespace RGB.NET.Devices.Logitech
{ {

View File

@ -1,16 +1,15 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("RGB.NET.Devices.Logitech")] [assembly: AssemblyTitle("RGB.NET.Devices.Logitech")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("Logitech-Device-Implementations of RGB.NET")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Wyrez")]
[assembly: AssemblyProduct("RGB.NET.Devices.Logitech")] [assembly: AssemblyProduct("RGB.NET.Devices.Logitech")]
[assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyCopyright("Copyright © Wyrez 2017")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]

View File

@ -58,8 +58,6 @@
<Compile Include="Generic\LogitechRGBDevice.cs" /> <Compile Include="Generic\LogitechRGBDevice.cs" />
<Compile Include="Generic\LogitechRGBDeviceInfo.cs" /> <Compile Include="Generic\LogitechRGBDeviceInfo.cs" />
<Compile Include="Helper\BitmapMapping.cs" /> <Compile Include="Helper\BitmapMapping.cs" />
<Compile Include="Helper\CultureHelper.cs" />
<Compile Include="Helper\PathHelper.cs" />
<Compile Include="HID\DeviceChecker.cs" /> <Compile Include="HID\DeviceChecker.cs" />
<Compile Include="Keyboard\LogitechKeyboardRGBDevice.cs" /> <Compile Include="Keyboard\LogitechKeyboardRGBDevice.cs" />
<Compile Include="Keyboard\LogitechKeyboardRGBDeviceInfo.cs" /> <Compile Include="Keyboard\LogitechKeyboardRGBDeviceInfo.cs" />

View File

@ -23,7 +23,7 @@ namespace RGB.NET.Groups
/// </summary> /// </summary>
public Rectangle Rectangle public Rectangle Rectangle
{ {
get { return _rectangle; } get => _rectangle;
set set
{ {
_rectangle = value; _rectangle = value;
@ -37,7 +37,7 @@ namespace RGB.NET.Groups
/// </summary> /// </summary>
public double MinOverlayPercentage public double MinOverlayPercentage
{ {
get { return _minOverlayPercentage; } get => _minOverlayPercentage;
set set
{ {
_minOverlayPercentage = value; _minOverlayPercentage = value;

View File

@ -23,8 +23,8 @@ namespace RGB.NET.WPF.Controls
/// </summary> /// </summary>
public Led Led public Led Led
{ {
get { return (Led)GetValue(LedProperty); } get => (Led)GetValue(LedProperty);
set { SetValue(LedProperty, value); } set => SetValue(LedProperty, value);
} }
// ReSharper restore InconsistentNaming // ReSharper restore InconsistentNaming

View File

@ -36,8 +36,8 @@ namespace RGB.NET.WPF.Controls
/// </summary> /// </summary>
public IRGBDevice Device public IRGBDevice Device
{ {
get { return (IRGBDevice)GetValue(DeviceProperty); } get => (IRGBDevice)GetValue(DeviceProperty);
set { SetValue(DeviceProperty, value); } set => SetValue(DeviceProperty, value);
} }
// ReSharper restore InconsistentNaming // ReSharper restore InconsistentNaming