From fc66ac0ceb1a99994d7ef1c8f0255496ec184cd9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 19 Sep 2015 16:24:14 +0200 Subject: [PATCH] Reorganized project into a (hopefully) better structure --- CUE.NET.csproj | 48 +++++++++---------- Wrapper/CueSDK.cs => CueSDK.cs | 11 +++-- .../Generic}/AbstractCueDevice.cs | 12 ++--- {Wrapper => Devices/Generic}/CorsairLed.cs | 4 +- .../Generic}/CorsairProtocolDetails.cs | 2 +- .../Generic/Enums}/CorsairAccessMode.cs | 2 +- .../Generic/Enums}/CorsairDeviceCaps.cs | 2 +- .../Generic/Enums}/CorsairDeviceType.cs | 2 +- .../Generic/Enums}/CorsairError.cs | 2 +- .../Generic}/GenericDeviceInfo.cs | 4 +- .../Headset/CorsairHeadset.cs | 4 +- Devices/Headset/CorsairHeadsetDeviceInfo.cs | 12 +++++ .../Headset/Enums}/CorsairHeadsetLedId.cs | 2 +- {Wrapper => Devices}/ICueDevice.cs | 2 +- {Wrapper => Devices}/IDeviceInfo.cs | 10 ++-- {Wrapper => Devices}/Keyboard/CorsairKey.cs | 5 +- .../Keyboard/CorsairKeyboard.cs | 11 +++-- .../Keyboard/CorsairKeyboardDeviceInfo.cs | 5 +- .../Keyboard/Enums}/CorsairKeyboardKeyId.cs | 2 +- .../Enums}/CorsairLogicalKeyboardLayout.cs | 2 +- .../Enums}/CorsairPhysicalKeyboardLayout.cs | 2 +- {Wrapper => Devices}/Mouse/CorsairMouse.cs | 4 +- .../Mouse/CorsairMouseDeviceInfo.cs | 5 +- .../Mouse/Enums}/CorsairMouseButtonId.cs | 2 +- .../Enums}/CorsairPhysicalMouseLayout.cs | 2 +- Examples/SimpleDevTest/Program.cs | 8 ++-- Exceptions/CUEException.cs | 2 +- Native/_CUESDK.cs | 20 ++++---- Native/_CorsairDeviceInfo.cs | 4 +- Native/_CorsairLedColor.cs | 2 +- Native/_CorsairLedPosition.cs | 2 +- Native/_CorsairLedPositions.cs | 2 +- Wrapper/Headset/CorsairHeadsetDeviceInfo.cs | 11 ----- 33 files changed, 111 insertions(+), 99 deletions(-) rename Wrapper/CueSDK.cs => CueSDK.cs (95%) rename {Wrapper => Devices/Generic}/AbstractCueDevice.cs (85%) rename {Wrapper => Devices/Generic}/CorsairLed.cs (85%) rename {Wrapper => Devices/Generic}/CorsairProtocolDetails.cs (98%) rename {Enums => Devices/Generic/Enums}/CorsairAccessMode.cs (86%) rename {Enums => Devices/Generic/Enums}/CorsairDeviceCaps.cs (92%) rename {Enums => Devices/Generic/Enums}/CorsairDeviceType.cs (88%) rename {Enums => Devices/Generic/Enums}/CorsairError.cs (97%) rename {Wrapper => Devices/Generic}/GenericDeviceInfo.cs (94%) rename {Wrapper => Devices}/Headset/CorsairHeadset.cs (84%) create mode 100644 Devices/Headset/CorsairHeadsetDeviceInfo.cs rename {Enums/Headset => Devices/Headset/Enums}/CorsairHeadsetLedId.cs (82%) rename {Wrapper => Devices}/ICueDevice.cs (82%) rename {Wrapper => Devices}/IDeviceInfo.cs (71%) rename {Wrapper => Devices}/Keyboard/CorsairKey.cs (80%) rename {Wrapper => Devices}/Keyboard/CorsairKeyboard.cs (77%) rename {Wrapper => Devices}/Keyboard/CorsairKeyboardDeviceInfo.cs (91%) rename {Enums/Keyboard => Devices/Keyboard/Enums}/CorsairKeyboardKeyId.cs (98%) rename {Enums/Keyboard => Devices/Keyboard/Enums}/CorsairLogicalKeyboardLayout.cs (93%) rename {Enums/Keyboard => Devices/Keyboard/Enums}/CorsairPhysicalKeyboardLayout.cs (94%) rename {Wrapper => Devices}/Mouse/CorsairMouse.cs (87%) rename {Wrapper => Devices}/Mouse/CorsairMouseDeviceInfo.cs (89%) rename {Enums/Mouse => Devices/Mouse/Enums}/CorsairMouseButtonId.cs (84%) rename {Enums/Mouse => Devices/Mouse/Enums}/CorsairPhysicalMouseLayout.cs (94%) delete mode 100644 Wrapper/Headset/CorsairHeadsetDeviceInfo.cs diff --git a/CUE.NET.csproj b/CUE.NET.csproj index e56c83b..441851d 100644 --- a/CUE.NET.csproj +++ b/CUE.NET.csproj @@ -60,27 +60,27 @@ - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -88,11 +88,11 @@ - - - - - + + + + + diff --git a/Wrapper/CueSDK.cs b/CueSDK.cs similarity index 95% rename from Wrapper/CueSDK.cs rename to CueSDK.cs index 58007b6..147ceb9 100644 --- a/Wrapper/CueSDK.cs +++ b/CueSDK.cs @@ -1,14 +1,15 @@ // ReSharper disable MemberCanBePrivate.Global using System.Runtime.InteropServices; -using CUE.NET.Enums; +using CUE.NET.Devices.Generic; +using CUE.NET.Devices.Generic.Enums; +using CUE.NET.Devices.Headset; +using CUE.NET.Devices.Keyboard; +using CUE.NET.Devices.Mouse; using CUE.NET.Exceptions; using CUE.NET.Native; -using CUE.NET.Wrapper.Headset; -using CUE.NET.Wrapper.Keyboard; -using CUE.NET.Wrapper.Mouse; -namespace CUE.NET.Wrapper +namespace CUE.NET { public static class CueSDK { diff --git a/Wrapper/AbstractCueDevice.cs b/Devices/Generic/AbstractCueDevice.cs similarity index 85% rename from Wrapper/AbstractCueDevice.cs rename to Devices/Generic/AbstractCueDevice.cs index 43f41cd..7418703 100644 --- a/Wrapper/AbstractCueDevice.cs +++ b/Devices/Generic/AbstractCueDevice.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Runtime.InteropServices; using CUE.NET.Native; -namespace CUE.NET.Wrapper +namespace CUE.NET.Devices.Generic { public abstract class AbstractCueDevice : ICueDevice { @@ -29,15 +29,15 @@ namespace CUE.NET.Wrapper protected CorsairLed GetLed(int ledId) { - if (!Leds.ContainsKey(ledId)) - Leds.Add(ledId, new CorsairLed()); + if (!this.Leds.ContainsKey(ledId)) + this.Leds.Add(ledId, new CorsairLed()); - return Leds[ledId]; + return this.Leds[ledId]; } public virtual void UpdateLeds(bool fullUpdate = false) { - IList> ledsToUpdate = (fullUpdate ? Leds : Leds.Where(x => x.Value.IsDirty)).ToList(); + IList> ledsToUpdate = (fullUpdate ? this.Leds : this.Leds.Where(x => x.Value.IsDirty)).ToList(); if (!ledsToUpdate.Any()) return; // CUE seems to crash if 'CorsairSetLedsColors' is called with a zero length array @@ -52,7 +52,7 @@ namespace CUE.NET.Wrapper ledId = led.Key, r = led.Value.Color.R, g = led.Value.Color.G, - b = led.Value.Color.B, + b = led.Value.Color.B }; Marshal.StructureToPtr(color, addPtr, false); diff --git a/Wrapper/CorsairLed.cs b/Devices/Generic/CorsairLed.cs similarity index 85% rename from Wrapper/CorsairLed.cs rename to Devices/Generic/CorsairLed.cs index 1f5a033..4a6e609 100644 --- a/Wrapper/CorsairLed.cs +++ b/Devices/Generic/CorsairLed.cs @@ -1,12 +1,12 @@ using System.Drawing; -namespace CUE.NET.Wrapper +namespace CUE.NET.Devices.Generic { public class CorsairLed { #region Properties & Fields - public bool IsDirty { get; set; } = false; + public bool IsDirty { get; private set; } = false; private Color _color = Color.Black; public Color Color diff --git a/Wrapper/CorsairProtocolDetails.cs b/Devices/Generic/CorsairProtocolDetails.cs similarity index 98% rename from Wrapper/CorsairProtocolDetails.cs rename to Devices/Generic/CorsairProtocolDetails.cs index f6db84d..2f53ea1 100644 --- a/Wrapper/CorsairProtocolDetails.cs +++ b/Devices/Generic/CorsairProtocolDetails.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.InteropServices; using CUE.NET.Native; -namespace CUE.NET.Wrapper +namespace CUE.NET.Devices.Generic { /// /// Managed wrapper for CorsairProtocolDetails. diff --git a/Enums/CorsairAccessMode.cs b/Devices/Generic/Enums/CorsairAccessMode.cs similarity index 86% rename from Enums/CorsairAccessMode.cs rename to Devices/Generic/Enums/CorsairAccessMode.cs index 5ff32c7..bf61975 100644 --- a/Enums/CorsairAccessMode.cs +++ b/Devices/Generic/Enums/CorsairAccessMode.cs @@ -1,7 +1,7 @@ // ReSharper disable InconsistentNaming // ReSharper disable UnusedMember.Global -namespace CUE.NET.Enums +namespace CUE.NET.Devices.Generic.Enums { /// /// Contains list of available SDK access modes. diff --git a/Enums/CorsairDeviceCaps.cs b/Devices/Generic/Enums/CorsairDeviceCaps.cs similarity index 92% rename from Enums/CorsairDeviceCaps.cs rename to Devices/Generic/Enums/CorsairDeviceCaps.cs index fb8c9a0..c3cc70e 100644 --- a/Enums/CorsairDeviceCaps.cs +++ b/Devices/Generic/Enums/CorsairDeviceCaps.cs @@ -3,7 +3,7 @@ using System; -namespace CUE.NET.Enums +namespace CUE.NET.Devices.Generic.Enums { /// /// Contains list of device capabilities diff --git a/Enums/CorsairDeviceType.cs b/Devices/Generic/Enums/CorsairDeviceType.cs similarity index 88% rename from Enums/CorsairDeviceType.cs rename to Devices/Generic/Enums/CorsairDeviceType.cs index 94f6148..4deeeba 100644 --- a/Enums/CorsairDeviceType.cs +++ b/Devices/Generic/Enums/CorsairDeviceType.cs @@ -1,7 +1,7 @@ // ReSharper disable InconsistentNaming // ReSharper disable UnusedMember.Global -namespace CUE.NET.Enums +namespace CUE.NET.Devices.Generic.Enums { /// /// Contains list of available device types. diff --git a/Enums/CorsairError.cs b/Devices/Generic/Enums/CorsairError.cs similarity index 97% rename from Enums/CorsairError.cs rename to Devices/Generic/Enums/CorsairError.cs index 029f65e..2cb220e 100644 --- a/Enums/CorsairError.cs +++ b/Devices/Generic/Enums/CorsairError.cs @@ -1,7 +1,7 @@ // ReSharper disable InconsistentNaming // ReSharper disable UnusedMember.Global -namespace CUE.NET.Enums +namespace CUE.NET.Devices.Generic.Enums { /// /// Shared list of all errors which could happen during calling of Corsair* functions. diff --git a/Wrapper/GenericDeviceInfo.cs b/Devices/Generic/GenericDeviceInfo.cs similarity index 94% rename from Wrapper/GenericDeviceInfo.cs rename to Devices/Generic/GenericDeviceInfo.cs index 5f0ad6f..4b979ef 100644 --- a/Wrapper/GenericDeviceInfo.cs +++ b/Devices/Generic/GenericDeviceInfo.cs @@ -1,9 +1,9 @@ using System; using System.Runtime.InteropServices; -using CUE.NET.Enums; +using CUE.NET.Devices.Generic.Enums; using CUE.NET.Native; -namespace CUE.NET.Wrapper +namespace CUE.NET.Devices.Generic { public class GenericDeviceInfo : IDeviceInfo { diff --git a/Wrapper/Headset/CorsairHeadset.cs b/Devices/Headset/CorsairHeadset.cs similarity index 84% rename from Wrapper/Headset/CorsairHeadset.cs rename to Devices/Headset/CorsairHeadset.cs index a9c4915..fba3820 100644 --- a/Wrapper/Headset/CorsairHeadset.cs +++ b/Devices/Headset/CorsairHeadset.cs @@ -1,4 +1,6 @@ -namespace CUE.NET.Wrapper.Headset +using CUE.NET.Devices.Generic; + +namespace CUE.NET.Devices.Headset { //TODO DarthAffe 18.09.2015: Implement public class CorsairHeadset : AbstractCueDevice diff --git a/Devices/Headset/CorsairHeadsetDeviceInfo.cs b/Devices/Headset/CorsairHeadsetDeviceInfo.cs new file mode 100644 index 0000000..d01f424 --- /dev/null +++ b/Devices/Headset/CorsairHeadsetDeviceInfo.cs @@ -0,0 +1,12 @@ +using CUE.NET.Devices.Generic; +using CUE.NET.Native; + +namespace CUE.NET.Devices.Headset +{ + public class CorsairHeadsetDeviceInfo : GenericDeviceInfo + { + internal CorsairHeadsetDeviceInfo(_CorsairDeviceInfo nativeInfo) + : base(nativeInfo) + { } + } +} diff --git a/Enums/Headset/CorsairHeadsetLedId.cs b/Devices/Headset/Enums/CorsairHeadsetLedId.cs similarity index 82% rename from Enums/Headset/CorsairHeadsetLedId.cs rename to Devices/Headset/Enums/CorsairHeadsetLedId.cs index 61e3b7c..c3ed34b 100644 --- a/Enums/Headset/CorsairHeadsetLedId.cs +++ b/Devices/Headset/Enums/CorsairHeadsetLedId.cs @@ -1,7 +1,7 @@ // ReSharper disable UnusedMember.Global // ReSharper disable InconsistentNaming -namespace CUE.NET.Enums.Headset +namespace CUE.NET.Devices.Headset.Enums { public enum CorsairHeadsetLedId { diff --git a/Wrapper/ICueDevice.cs b/Devices/ICueDevice.cs similarity index 82% rename from Wrapper/ICueDevice.cs rename to Devices/ICueDevice.cs index 45971d9..7224e1c 100644 --- a/Wrapper/ICueDevice.cs +++ b/Devices/ICueDevice.cs @@ -1,4 +1,4 @@ -namespace CUE.NET.Wrapper +namespace CUE.NET.Devices { public interface ICueDevice { diff --git a/Wrapper/IDeviceInfo.cs b/Devices/IDeviceInfo.cs similarity index 71% rename from Wrapper/IDeviceInfo.cs rename to Devices/IDeviceInfo.cs index d55fab8..75ff15a 100644 --- a/Wrapper/IDeviceInfo.cs +++ b/Devices/IDeviceInfo.cs @@ -1,12 +1,14 @@ -using CUE.NET.Enums; +using CUE.NET.Devices.Generic.Enums; -namespace CUE.NET.Wrapper +namespace CUE.NET.Devices { public interface IDeviceInfo { + /// + /// Device type + /// CorsairDeviceType Type { get; } - - //TODO DarthAffe 17.09.2015: This could be an Enum + /// /// Device model (like “K95RGB”). /// diff --git a/Wrapper/Keyboard/CorsairKey.cs b/Devices/Keyboard/CorsairKey.cs similarity index 80% rename from Wrapper/Keyboard/CorsairKey.cs rename to Devices/Keyboard/CorsairKey.cs index a56d058..1873512 100644 --- a/Wrapper/Keyboard/CorsairKey.cs +++ b/Devices/Keyboard/CorsairKey.cs @@ -1,6 +1,7 @@ -using CUE.NET.Enums.Keyboard; +using CUE.NET.Devices.Generic; +using CUE.NET.Devices.Keyboard.Enums; -namespace CUE.NET.Wrapper.Keyboard +namespace CUE.NET.Devices.Keyboard { public class CorsairKey { diff --git a/Wrapper/Keyboard/CorsairKeyboard.cs b/Devices/Keyboard/CorsairKeyboard.cs similarity index 77% rename from Wrapper/Keyboard/CorsairKeyboard.cs rename to Devices/Keyboard/CorsairKeyboard.cs index e5915ed..3b4d1af 100644 --- a/Wrapper/Keyboard/CorsairKeyboard.cs +++ b/Devices/Keyboard/CorsairKeyboard.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; -using CUE.NET.Enums.Keyboard; +using CUE.NET.Devices.Generic; +using CUE.NET.Devices.Keyboard.Enums; -namespace CUE.NET.Wrapper.Keyboard +namespace CUE.NET.Devices.Keyboard { public class CorsairKeyboard : AbstractCueDevice { @@ -13,7 +14,7 @@ namespace CUE.NET.Wrapper.Keyboard private Dictionary _keys = new Dictionary(); public CorsairKey this[CorsairKeyboardKeyId keyId] { - get { return _keys[keyId]; } + get { return this._keys[keyId]; } private set { throw new NotSupportedException(); } } @@ -26,7 +27,7 @@ namespace CUE.NET.Wrapper.Keyboard { this.KeyboardDeviceInfo = info; - InitializeKeys(); + this.InitializeKeys(); } #endregion @@ -36,7 +37,7 @@ namespace CUE.NET.Wrapper.Keyboard private void InitializeKeys() { foreach (CorsairKeyboardKeyId keyId in Enum.GetValues(typeof(CorsairKeyboardKeyId))) - _keys.Add(keyId, new CorsairKey(keyId, GetLed((int)keyId))); + this._keys.Add(keyId, new CorsairKey(keyId, this.GetLed((int)keyId))); } #endregion diff --git a/Wrapper/Keyboard/CorsairKeyboardDeviceInfo.cs b/Devices/Keyboard/CorsairKeyboardDeviceInfo.cs similarity index 91% rename from Wrapper/Keyboard/CorsairKeyboardDeviceInfo.cs rename to Devices/Keyboard/CorsairKeyboardDeviceInfo.cs index 0855745..19adc41 100644 --- a/Wrapper/Keyboard/CorsairKeyboardDeviceInfo.cs +++ b/Devices/Keyboard/CorsairKeyboardDeviceInfo.cs @@ -1,10 +1,11 @@ // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedAutoPropertyAccessor.Global -using CUE.NET.Enums.Keyboard; +using CUE.NET.Devices.Generic; +using CUE.NET.Devices.Keyboard.Enums; using CUE.NET.Native; -namespace CUE.NET.Wrapper.Keyboard +namespace CUE.NET.Devices.Keyboard { public class CorsairKeyboardDeviceInfo : GenericDeviceInfo { diff --git a/Enums/Keyboard/CorsairKeyboardKeyId.cs b/Devices/Keyboard/Enums/CorsairKeyboardKeyId.cs similarity index 98% rename from Enums/Keyboard/CorsairKeyboardKeyId.cs rename to Devices/Keyboard/Enums/CorsairKeyboardKeyId.cs index a94698b..33eb3b9 100644 --- a/Enums/Keyboard/CorsairKeyboardKeyId.cs +++ b/Devices/Keyboard/Enums/CorsairKeyboardKeyId.cs @@ -1,7 +1,7 @@ // ReSharper disable UnusedMember.Global // ReSharper disable InconsistentNaming -namespace CUE.NET.Enums.Keyboard +namespace CUE.NET.Devices.Keyboard.Enums { public enum CorsairKeyboardKeyId { diff --git a/Enums/Keyboard/CorsairLogicalKeyboardLayout.cs b/Devices/Keyboard/Enums/CorsairLogicalKeyboardLayout.cs similarity index 93% rename from Enums/Keyboard/CorsairLogicalKeyboardLayout.cs rename to Devices/Keyboard/Enums/CorsairLogicalKeyboardLayout.cs index d9dc0c9..17577fd 100644 --- a/Enums/Keyboard/CorsairLogicalKeyboardLayout.cs +++ b/Devices/Keyboard/Enums/CorsairLogicalKeyboardLayout.cs @@ -1,7 +1,7 @@ // ReSharper disable InconsistentNaming // ReSharper disable UnusedMember.Global -namespace CUE.NET.Enums.Keyboard +namespace CUE.NET.Devices.Keyboard.Enums { /// /// Contains list of available logical layouts for keyboards. diff --git a/Enums/Keyboard/CorsairPhysicalKeyboardLayout.cs b/Devices/Keyboard/Enums/CorsairPhysicalKeyboardLayout.cs similarity index 94% rename from Enums/Keyboard/CorsairPhysicalKeyboardLayout.cs rename to Devices/Keyboard/Enums/CorsairPhysicalKeyboardLayout.cs index 5dc71d1..ef24900 100644 --- a/Enums/Keyboard/CorsairPhysicalKeyboardLayout.cs +++ b/Devices/Keyboard/Enums/CorsairPhysicalKeyboardLayout.cs @@ -1,7 +1,7 @@ // ReSharper disable UnusedMember.Global // ReSharper disable InconsistentNaming -namespace CUE.NET.Enums.Keyboard +namespace CUE.NET.Devices.Keyboard.Enums { /// /// Contains list of available physical layouts for keyboards. diff --git a/Wrapper/Mouse/CorsairMouse.cs b/Devices/Mouse/CorsairMouse.cs similarity index 87% rename from Wrapper/Mouse/CorsairMouse.cs rename to Devices/Mouse/CorsairMouse.cs index fc33056..f92aa9c 100644 --- a/Wrapper/Mouse/CorsairMouse.cs +++ b/Devices/Mouse/CorsairMouse.cs @@ -1,4 +1,6 @@ -namespace CUE.NET.Wrapper.Mouse +using CUE.NET.Devices.Generic; + +namespace CUE.NET.Devices.Mouse { //TODO DarthAffe 18.09.2015: Implement public class CorsairMouse : AbstractCueDevice diff --git a/Wrapper/Mouse/CorsairMouseDeviceInfo.cs b/Devices/Mouse/CorsairMouseDeviceInfo.cs similarity index 89% rename from Wrapper/Mouse/CorsairMouseDeviceInfo.cs rename to Devices/Mouse/CorsairMouseDeviceInfo.cs index 8095acd..9972fc7 100644 --- a/Wrapper/Mouse/CorsairMouseDeviceInfo.cs +++ b/Devices/Mouse/CorsairMouseDeviceInfo.cs @@ -1,10 +1,11 @@ // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedAutoPropertyAccessor.Global -using CUE.NET.Enums.Mouse; +using CUE.NET.Devices.Generic; +using CUE.NET.Devices.Mouse.Enums; using CUE.NET.Native; -namespace CUE.NET.Wrapper.Mouse +namespace CUE.NET.Devices.Mouse { public class CorsairMouseDeviceInfo : GenericDeviceInfo { diff --git a/Enums/Mouse/CorsairMouseButtonId.cs b/Devices/Mouse/Enums/CorsairMouseButtonId.cs similarity index 84% rename from Enums/Mouse/CorsairMouseButtonId.cs rename to Devices/Mouse/Enums/CorsairMouseButtonId.cs index b33ff61..38a3b60 100644 --- a/Enums/Mouse/CorsairMouseButtonId.cs +++ b/Devices/Mouse/Enums/CorsairMouseButtonId.cs @@ -1,7 +1,7 @@ // ReSharper disable UnusedMember.Global // ReSharper disable InconsistentNaming -namespace CUE.NET.Enums.Mouse +namespace CUE.NET.Devices.Mouse.Enums { public enum CorsairMouseLedId { diff --git a/Enums/Mouse/CorsairPhysicalMouseLayout.cs b/Devices/Mouse/Enums/CorsairPhysicalMouseLayout.cs similarity index 94% rename from Enums/Mouse/CorsairPhysicalMouseLayout.cs rename to Devices/Mouse/Enums/CorsairPhysicalMouseLayout.cs index 0198e00..a8383c8 100644 --- a/Enums/Mouse/CorsairPhysicalMouseLayout.cs +++ b/Devices/Mouse/Enums/CorsairPhysicalMouseLayout.cs @@ -1,7 +1,7 @@ // ReSharper disable UnusedMember.Global // ReSharper disable InconsistentNaming -namespace CUE.NET.Enums.Mouse +namespace CUE.NET.Devices.Mouse.Enums { /// /// Contains list of available physical layouts for mice. diff --git a/Examples/SimpleDevTest/Program.cs b/Examples/SimpleDevTest/Program.cs index 5638fb8..b2fba43 100644 --- a/Examples/SimpleDevTest/Program.cs +++ b/Examples/SimpleDevTest/Program.cs @@ -1,10 +1,10 @@ using System; using System.Drawing; -using CUE.NET.Enums; -using CUE.NET.Enums.Keyboard; +using CUE.NET; +using CUE.NET.Devices.Generic.Enums; +using CUE.NET.Devices.Keyboard; +using CUE.NET.Devices.Keyboard.Enums; using CUE.NET.Exceptions; -using CUE.NET.Wrapper; -using CUE.NET.Wrapper.Keyboard; namespace SimpleDevTest { diff --git a/Exceptions/CUEException.cs b/Exceptions/CUEException.cs index 5e1612c..bf09654 100644 --- a/Exceptions/CUEException.cs +++ b/Exceptions/CUEException.cs @@ -2,7 +2,7 @@ // ReSharper disable MemberCanBePrivate.Global using System; -using CUE.NET.Enums; +using CUE.NET.Devices.Generic.Enums; namespace CUE.NET.Exceptions { diff --git a/Native/_CUESDK.cs b/Native/_CUESDK.cs index 2692bf3..c5df2d5 100644 --- a/Native/_CUESDK.cs +++ b/Native/_CUESDK.cs @@ -1,6 +1,6 @@ using System; using System.Runtime.InteropServices; -using CUE.NET.Enums; +using CUE.NET.Devices.Generic.Enums; namespace CUE.NET.Native { @@ -13,14 +13,14 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // set specified leds to some colors. The color is retained until changed by successive calls. This function does not take logical layout into account - public static extern bool CorsairSetLedsColors(int size, IntPtr ledsColors); + internal static extern bool CorsairSetLedsColors(int size, IntPtr ledsColors); //#if WIN64 // [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] //#else // [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] //#endif - //public static extern bool CorsairSetLedsColorsAsync(int size, CorsairLedColor* ledsColors, void(*CallbackType)(void*, bool, CorsairError), void* context); + //internal static extern bool CorsairSetLedsColorsAsync(int size, CorsairLedColor* ledsColors, void(*CallbackType)(void*, bool, CorsairError), void* context); #if WIN64 [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] @@ -28,7 +28,7 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // returns number of connected Corsair devices that support lighting control. - public static extern int CorsairGetDeviceCount(); + internal static extern int CorsairGetDeviceCount(); #if WIN64 [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] @@ -36,7 +36,7 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // returns information about device at provided index - public static extern IntPtr CorsairGetDeviceInfo(int deviceIndex); + internal static extern IntPtr CorsairGetDeviceInfo(int deviceIndex); #if WIN64 [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] @@ -44,7 +44,7 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // provides list of keyboard LEDs with their physical positions. - public static extern IntPtr CorsairGetLedPositions(); + internal static extern IntPtr CorsairGetLedPositions(); #if WIN64 [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] @@ -52,7 +52,7 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // retrieves led id for key name taking logical layout into account. - public static extern int CorsairGetLedIdForKeyName(char keyName); + internal static extern int CorsairGetLedIdForKeyName(char keyName); #if WIN64 [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] @@ -60,7 +60,7 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // requestes control using specified access mode. By default client has shared control over lighting so there is no need to call CorsairRequestControl unless client requires exclusive control - public static extern bool CorsairRequestControl(CorsairAccessMode accessMode); + internal static extern bool CorsairRequestControl(CorsairAccessMode accessMode); #if WIN64 [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] @@ -68,7 +68,7 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // checks file and protocol version of CUE to understand which of SDK functions can be used with this version of CUE - public static extern _CorsairProtocolDetails CorsairPerformProtocolHandshake(); + internal static extern _CorsairProtocolDetails CorsairPerformProtocolHandshake(); #if WIN64 [DllImport("CUESDK.x64_2013.dll", CallingConvention = CallingConvention.Cdecl)] @@ -76,6 +76,6 @@ namespace CUE.NET.Native [DllImport("CUESDK_2013.dll", CallingConvention = CallingConvention.Cdecl)] #endif // returns last error that occured while using any of Corsair* functions - public static extern CorsairError CorsairGetLastError(); + internal static extern CorsairError CorsairGetLastError(); } } diff --git a/Native/_CorsairDeviceInfo.cs b/Native/_CorsairDeviceInfo.cs index bbe3827..846e240 100644 --- a/Native/_CorsairDeviceInfo.cs +++ b/Native/_CorsairDeviceInfo.cs @@ -4,13 +4,13 @@ using System; using System.Runtime.InteropServices; -using CUE.NET.Enums; +using CUE.NET.Devices.Generic.Enums; namespace CUE.NET.Native { // ReSharper disable once InconsistentNaming [StructLayout(LayoutKind.Sequential)] - public class _CorsairDeviceInfo // contains information about device + internal class _CorsairDeviceInfo // contains information about device { internal CorsairDeviceType type; // enum describing device type internal IntPtr model; // null - terminated device model(like “K95RGB”) diff --git a/Native/_CorsairLedColor.cs b/Native/_CorsairLedColor.cs index 8761f63..489589a 100644 --- a/Native/_CorsairLedColor.cs +++ b/Native/_CorsairLedColor.cs @@ -8,7 +8,7 @@ namespace CUE.NET.Native { // ReSharper disable once InconsistentNaming [StructLayout(LayoutKind.Sequential)] - public class _CorsairLedColor // contains information about led and its color + internal class _CorsairLedColor // contains information about led and its color { internal int ledId; // identifier of LED to set diff --git a/Native/_CorsairLedPosition.cs b/Native/_CorsairLedPosition.cs index 642d105..2d5d472 100644 --- a/Native/_CorsairLedPosition.cs +++ b/Native/_CorsairLedPosition.cs @@ -8,7 +8,7 @@ namespace CUE.NET.Native { // ReSharper disable once InconsistentNaming [StructLayout(LayoutKind.Sequential)] - public class _CorsairLedPosition // contains led id and position of led rectangle.Most of the keys are rectangular. In case if key is not rectangular(like Enter in ISO / UK layout) it returns the smallest rectangle that fully contains the key + internal class _CorsairLedPosition // contains led id and position of led rectangle.Most of the keys are rectangular. In case if key is not rectangular(like Enter in ISO / UK layout) it returns the smallest rectangle that fully contains the key { internal int ledId; // identifier of led internal double top; diff --git a/Native/_CorsairLedPositions.cs b/Native/_CorsairLedPositions.cs index d299e25..9bcfd9e 100644 --- a/Native/_CorsairLedPositions.cs +++ b/Native/_CorsairLedPositions.cs @@ -9,7 +9,7 @@ namespace CUE.NET.Native { // ReSharper disable once InconsistentNaming [StructLayout(LayoutKind.Sequential)] - public class _CorsairLedPositions // contains number of leds and arrays with their positions + internal class _CorsairLedPositions // contains number of leds and arrays with their positions { internal int numberOfLed; // integer value.Number of elements in following array internal IntPtr pLedPosition; // array of led positions diff --git a/Wrapper/Headset/CorsairHeadsetDeviceInfo.cs b/Wrapper/Headset/CorsairHeadsetDeviceInfo.cs deleted file mode 100644 index 2b8af06..0000000 --- a/Wrapper/Headset/CorsairHeadsetDeviceInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -using CUE.NET.Native; - -namespace CUE.NET.Wrapper.Headset -{ - public class CorsairHeadsetDeviceInfo : GenericDeviceInfo - { - public CorsairHeadsetDeviceInfo(_CorsairDeviceInfo nativeInfo) - : base(nativeInfo) - { } - } -}