mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Fixed code issues
This commit is contained in:
1 parent
4466acfbf7
commit
7b0e9152fd
54 files changed
+330
-275
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace RGB.NET.Devices.CoolerMaster.Helper
|
||||
/// </summary>
|
||||
/// <param name="source">The enum value to get the description from.</param>
|
||||
/// <returns>The value of the <see cref="DescriptionAttribute"/> or the <see cref="Enum.ToString()" /> result of the source.</returns>
|
||||
internal static string? GetDescription(this Enum source)
|
||||
internal static string GetDescription(this Enum source)
|
||||
=> source.GetAttribute<DescriptionAttribute>()?.Description ?? source.ToString();
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -18,7 +18,9 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
/// <param name="info">The specific information provided by CoolerMaster for the mouse</param>
|
||||
internal CoolerMasterMouseRGBDevice(CoolerMasterMouseRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
|
||||
: base(info, updateTrigger)
|
||||
{ }
|
||||
{
|
||||
InitializeLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user