Improved LedId enums (now constants)

This commit is contained in:
DarthAffe committed 2016-09-10 17:44:35 +02:00
1 parent 223c0e8886
commit f8c537aaff
11 files changed
+243 -232

No files matched your search

+10 -10
View File
@@ -45,22 +45,22 @@ namespace CUE.NET.Devices.Mouse
switch (MouseDeviceInfo.PhysicalLayout)
{
case CorsairPhysicalMouseLayout.Zones1:
InitializeLed((CorsairLedId)CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
break;
case CorsairPhysicalMouseLayout.Zones2:
InitializeLed((CorsairLedId)CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
InitializeLed((CorsairLedId)CorsairMouseLedId.B2, new RectangleF(1, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B2, new RectangleF(1, 0, 1, 1));
break;
case CorsairPhysicalMouseLayout.Zones3:
InitializeLed((CorsairLedId)CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
InitializeLed((CorsairLedId)CorsairMouseLedId.B2, new RectangleF(1, 0, 1, 1));
InitializeLed((CorsairLedId)CorsairMouseLedId.B3, new RectangleF(2, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B2, new RectangleF(1, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B3, new RectangleF(2, 0, 1, 1));
break;
case CorsairPhysicalMouseLayout.Zones4:
InitializeLed((CorsairLedId)CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
InitializeLed((CorsairLedId)CorsairMouseLedId.B2, new RectangleF(1, 0, 1, 1));
InitializeLed((CorsairLedId)CorsairMouseLedId.B3, new RectangleF(2, 0, 1, 1));
InitializeLed((CorsairLedId)CorsairMouseLedId.B4, new RectangleF(3, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B1, new RectangleF(0, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B2, new RectangleF(1, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B3, new RectangleF(2, 0, 1, 1));
InitializeLed(CorsairMouseLedId.B4, new RectangleF(3, 0, 1, 1));
break;
default:
throw new WrapperException($"Can't initial mouse with layout '{MouseDeviceInfo.PhysicalLayout}'");
@@ -1,17 +0,0 @@
// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming
namespace CUE.NET.Devices.Mouse.Enums
{
/// <summary>
/// Contains list of all LEDs available for corsair mice.
/// </summary>
public enum CorsairMouseLedId
{
Invalid = 0,
B1 = 148,
B2 = 149,
B3 = 150,
B4 = 151
}
}
+19
View File
@@ -0,0 +1,19 @@
// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming
using CUE.NET.Devices.Generic.Enums;
namespace CUE.NET.Devices.Mouse.Enums
{
/// <summary>
/// Contains list of all LEDs available for corsair mice.
/// </summary>
public static class CorsairMouseLedId
{
public const CorsairLedId Invalid = CorsairLedId.Invalid;
public const CorsairLedId B1 = CorsairLedId.B1;
public const CorsairLedId B2 = CorsairLedId.B2;
public const CorsairLedId B3 = CorsairLedId.B3;
public const CorsairLedId B4 = CorsairLedId.B4;
}
}