diff --git a/RGB.NET.Brushes/RGB.NET.Brushes.csproj b/RGB.NET.Brushes/RGB.NET.Brushes.csproj
index d016193..f17e2aa 100644
--- a/RGB.NET.Brushes/RGB.NET.Brushes.csproj
+++ b/RGB.NET.Brushes/RGB.NET.Brushes.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -61,8 +53,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Core/RGB.NET.Core.csproj b/RGB.NET.Core/RGB.NET.Core.csproj
index 6fab932..67fe585 100644
--- a/RGB.NET.Core/RGB.NET.Core.csproj
+++ b/RGB.NET.Core/RGB.NET.Core.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -57,8 +49,4 @@
$(NoWarn);CS1591;CS1572;CS1573
$(DefineConstants);RELEASE
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Decorators/RGB.NET.Decorators.csproj b/RGB.NET.Decorators/RGB.NET.Decorators.csproj
index f76251d..f87a519 100644
--- a/RGB.NET.Decorators/RGB.NET.Decorators.csproj
+++ b/RGB.NET.Decorators/RGB.NET.Decorators.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -62,8 +54,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.Asus/Helper/WMIHelper.cs b/RGB.NET.Devices.Asus/Helper/WMIHelper.cs
index 0ea746e..0a43046 100644
--- a/RGB.NET.Devices.Asus/Helper/WMIHelper.cs
+++ b/RGB.NET.Devices.Asus/Helper/WMIHelper.cs
@@ -1,4 +1,4 @@
-#if NETFULL
+using System;
using System.Management;
namespace RGB.NET.Devices.Asus
@@ -8,11 +8,26 @@ namespace RGB.NET.Devices.Asus
{
#region Properties & Fields
- private static ManagementObjectSearcher _mainboardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Manufacturer,Product FROM Win32_BaseBoard");
- private static ManagementObjectSearcher _graphicsCardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Name FROM Win32_VideoController");
+ // ReSharper disable InconsistentNaming
+ private static readonly ManagementObjectSearcher? _mainboardSearcher;
+ private static readonly ManagementObjectSearcher? _graphicsCardSearcher;
+ // ReSharper restore InconsistentNaming
private static (string manufacturer, string model)? _mainboardInfo;
- private static string _graphicsCardInfo;
+ private static string? _graphicsCardInfo;
+
+ #endregion
+
+ #region Constructors
+
+ static WMIHelper()
+ {
+ if (OperatingSystem.IsWindows())
+ {
+ _mainboardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Manufacturer,Product FROM Win32_BaseBoard");
+ _graphicsCardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Name FROM Win32_VideoController");
+ }
+ }
#endregion
@@ -20,19 +35,23 @@ namespace RGB.NET.Devices.Asus
internal static (string manufacturer, string model)? GetMainboardInfo()
{
- if (!_mainboardInfo.HasValue)
+ if (!OperatingSystem.IsWindows()) return null;
+
+ if (!_mainboardInfo.HasValue && (_mainboardSearcher != null))
foreach (ManagementBaseObject managementBaseObject in _mainboardSearcher.Get())
{
- _mainboardInfo = (managementBaseObject["Manufacturer"]?.ToString(), managementBaseObject["Product"]?.ToString());
+ _mainboardInfo = (managementBaseObject["Manufacturer"]?.ToString() ?? string.Empty, managementBaseObject["Product"]?.ToString() ?? string.Empty);
break;
}
return _mainboardInfo;
}
- internal static string GetGraphicsCardsInfo()
+ internal static string? GetGraphicsCardsInfo()
{
- if (_graphicsCardInfo == null)
+ if (!OperatingSystem.IsWindows()) return null;
+
+ if ((_graphicsCardInfo == null) && (_graphicsCardSearcher != null))
foreach (ManagementBaseObject managementBaseObject in _graphicsCardSearcher.Get())
{
_graphicsCardInfo = managementBaseObject["Name"]?.ToString();
@@ -44,20 +63,4 @@ namespace RGB.NET.Devices.Asus
#endregion
}
-}
-#else
-namespace RGB.NET.Devices.Asus
-{
- // ReSharper disable once InconsistentNaming
- internal static class WMIHelper
- {
- #region Methods
-
- internal static (string manufacturer, string model)? GetMainboardInfo() => null;
-
- internal static string GetGraphicsCardsInfo() => null;
-
- #endregion
- }
-}
-#endif
+}
\ No newline at end of file
diff --git a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj
index fb26c95..3b81186 100644
--- a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj
+++ b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -59,16 +51,13 @@
- <_PackageFiles Include="$(OutputPath)\net45\Interop.AuraServiceLib.dll">
- None
- lib\net45\
-
+
- <_PackageFiles Include="$(OutputPath)\netstandard2.0\Interop.AuraServiceLib.dll">
+ <_PackageFiles Include="$(OutputPath)\net5.0\Interop.AuraServiceLib.dll">
None
- lib\netstandard2.0\
+ lib\net5.0\
@@ -76,11 +65,6 @@
-
-
-
-
-
lib\Interop.AuraServiceLib.dll
diff --git a/RGB.NET.Devices.Asus_Legacy/AsusDeviceProvider.cs b/RGB.NET.Devices.Asus_Legacy/AsusDeviceProvider.cs
deleted file mode 100644
index 6dbae09..0000000
--- a/RGB.NET.Devices.Asus_Legacy/AsusDeviceProvider.cs
+++ /dev/null
@@ -1,280 +0,0 @@
-// ReSharper disable MemberCanBePrivate.Global
-// ReSharper disable UnusedMember.Global
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using RGB.NET.Core;
-using RGB.NET.Devices.Asus.Native;
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- ///
- /// Represents a device provider responsible for Cooler Master devices.
- ///
- [Obsolete("Use this only if you need syncback-capability")]
- public class AsusDeviceProvider : IRGBDeviceProvider
- {
- #region Properties & Fields
-
- private static AsusDeviceProvider _instance;
- ///
- /// Gets the singleton instance.
- ///
- public static AsusDeviceProvider Instance => _instance ?? new AsusDeviceProvider();
-
- ///
- /// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications.
- /// The first match will be used.
- ///
- public static List PossibleX86NativePaths { get; } = new List { "x86/AURA_SDK.dll" };
-
- ///
- /// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications.
- /// The first match will be used.
- ///
- public static List PossibleX64NativePaths { get; } = new List { };
-
- ///
- ///
- /// Indicates if the SDK is initialized and ready to use.
- ///
- public bool IsInitialized { get; private set; }
-
- ///
- /// Gets the loaded architecture (x64/x86).
- ///
- public string LoadedArchitecture => _AsusSDK.LoadedArchitecture;
-
- ///
- ///
- /// Gets whether the application has exclusive access to the SDK or not.
- ///
- public bool HasExclusiveAccess { get; private set; }
-
- ///
- public IEnumerable Devices { get; private set; }
-
- ///
- /// Gets or sets a function to get the culture for a specific device.
- ///
- // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global
- public Func GetCulture { get; set; } = CultureHelper.GetCurrentCulture;
-
- ///
- /// The used to trigger the updates for asus devices.
- ///
- public DeviceUpdateTrigger UpdateTrigger { get; private set; }
-
- #endregion
-
- #region Constructors
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// Thrown if this constructor is called even if there is already an instance of this class.
- public AsusDeviceProvider()
- {
- if (_instance != null) throw new InvalidOperationException($"There can be only one instance of type {nameof(AsusDeviceProvider)}");
- _instance = this;
-
- UpdateTrigger = new DeviceUpdateTrigger();
- }
-
- #endregion
-
- #region Methods
-
- ///
- public bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool exclusiveAccessIfPossible = false, bool throwExceptions = false)
- {
- IsInitialized = false;
-
- try
- {
- UpdateTrigger?.Stop();
-
- _AsusSDK.Reload();
-
- IList devices = new List();
-
- #region Mainboard
-
- if (loadFilter.HasFlag(RGBDeviceType.Mainboard))
- try
- {
- //TODO DarthAffe 26.11.2017: This is not a fix! There might really be a second controller on the mainboard, but for now this should prevent the random crash for some guys.
- // DarthAffe 26.11.2017: https://rog.asus.com/forum/showthread.php?97754-Access-Violation-Wrong-EnumerateMB-Result&p=688901#post688901
- int mainboardCount = Math.Min(1, _AsusSDK.EnumerateMbController(IntPtr.Zero, 0));
- if (mainboardCount > 0)
- {
- IntPtr mainboardHandles = Marshal.AllocHGlobal(mainboardCount * IntPtr.Size);
- _AsusSDK.EnumerateMbController(mainboardHandles, mainboardCount);
-
- for (int i = 0; i < mainboardCount; i++)
- {
- try
- {
- IntPtr handle = Marshal.ReadIntPtr(mainboardHandles, i);
- _AsusSDK.SetMbMode(handle, 1);
- AsusMainboardRGBDevice device = new AsusMainboardRGBDevice(new AsusMainboardRGBDeviceInfo(RGBDeviceType.Mainboard, handle));
- device.Initialize(UpdateTrigger);
- devices.Add(device);
- }
- catch { if (throwExceptions) throw; }
- }
- }
- }
- catch { if (throwExceptions) throw; }
-
- #endregion
-
- #region Graphics cards
-
- //TODO DarthAffe 21.10.2017: This somehow returns non-existant gpus (at least for me) which cause huge lags (if a real asus-ready gpu is connected this doesn't happen)
-
- if (loadFilter.HasFlag(RGBDeviceType.GraphicsCard))
- try
- {
- int graphicCardCount = _AsusSDK.EnumerateGPU(IntPtr.Zero, 0);
- if (graphicCardCount > 0)
- {
- IntPtr grapicsCardHandles = Marshal.AllocHGlobal(graphicCardCount * IntPtr.Size);
- _AsusSDK.EnumerateGPU(grapicsCardHandles, graphicCardCount);
-
- for (int i = 0; i < graphicCardCount; i++)
- {
- try
- {
- IntPtr handle = Marshal.ReadIntPtr(grapicsCardHandles, i);
- _AsusSDK.SetGPUMode(handle, 1);
- AsusGraphicsCardRGBDevice device = new AsusGraphicsCardRGBDevice(new AsusGraphicsCardRGBDeviceInfo(RGBDeviceType.GraphicsCard, handle));
- device.Initialize(UpdateTrigger);
- devices.Add(device);
- }
- catch { if (throwExceptions) throw; }
- }
- }
- }
- catch { if (throwExceptions) throw; }
-
- #endregion
-
- #region DRAM
-
- //TODO DarthAffe 29.10.2017: I don't know why they are even documented, but the asus guy said they aren't in the SDK right now.
- //try
- //{
- //int dramCount = _AsusSDK.EnumerateDram(IntPtr.Zero, 0);
- //if (dramCount > 0)
- //{
- // IntPtr dramHandles = Marshal.AllocHGlobal(dramCount * IntPtr.Size);
- // _AsusSDK.EnumerateDram(dramHandles, dramCount);
-
- // for (int i = 0; i < dramCount; i++)
- // {
- //try
- //{
- // IntPtr handle = Marshal.ReadIntPtr(dramHandles, i);
- // _AsusSDK.SetDramMode(handle, 1);
- // AsusDramRGBDevice device = new AsusDramRGBDevice(new AsusDramRGBDeviceInfo(RGBDeviceType.DRAM, handle));
- // device.Initialize(UpdateTrigger);
- // devices.Add(device);
- // }
- //catch { if (throwExceptions) throw; }
- // }
- //}
- //}
- // catch { if (throwExceptions) throw; }
-
- #endregion
-
- #region Keyboard
-
- if (loadFilter.HasFlag(RGBDeviceType.Keyboard))
- try
- {
- IntPtr keyboardHandle = Marshal.AllocHGlobal(IntPtr.Size);
- if (_AsusSDK.CreateClaymoreKeyboard(keyboardHandle))
- {
- _AsusSDK.SetClaymoreKeyboardMode(keyboardHandle, 1);
- AsusKeyboardRGBDevice device = new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(RGBDeviceType.Keyboard, keyboardHandle, GetCulture()));
- device.Initialize(UpdateTrigger);
- devices.Add(device);
- }
- }
- catch { if (throwExceptions) throw; }
-
- #endregion
-
- #region Mouse
-
- if (loadFilter.HasFlag(RGBDeviceType.Mouse))
- try
- {
- IntPtr mouseHandle = Marshal.AllocHGlobal(IntPtr.Size);
- if (_AsusSDK.CreateRogMouse(mouseHandle))
- {
- _AsusSDK.SetRogMouseMode(mouseHandle, 1);
- AsusMouseRGBDevice device = new AsusMouseRGBDevice(new AsusMouseRGBDeviceInfo(RGBDeviceType.Mouse, mouseHandle));
- device.Initialize(UpdateTrigger);
- devices.Add(device);
- }
- }
- catch { if (throwExceptions) throw; }
-
- #endregion
-
- UpdateTrigger?.Start();
-
- Devices = new ReadOnlyCollection(devices);
- IsInitialized = true;
- }
- catch
- {
- if (throwExceptions)
- throw;
- return false;
- }
-
- return true;
- }
-
- ///
- public void ResetDevices()
- {
- foreach (IRGBDevice device in Devices)
- {
- AsusRGBDeviceInfo deviceInfo = (AsusRGBDeviceInfo)device.DeviceInfo;
- switch (deviceInfo.DeviceType)
- {
- case RGBDeviceType.Mainboard:
- _AsusSDK.SetMbMode(deviceInfo.Handle, 0);
- break;
- case RGBDeviceType.GraphicsCard:
- _AsusSDK.SetGPUMode(deviceInfo.Handle, 0);
- break;
- //case RGBDeviceType.DRAM:
- // _AsusSDK.SetDramMode(deviceInfo.Handle, 0);
- // break;
- }
- }
- }
-
- ///
- public void Dispose()
- {
- try { UpdateTrigger?.Dispose(); }
- catch { /* at least we tried */ }
-
- try { _AsusSDK.UnloadAsusSDK(); }
- catch { /* at least we tried */ }
- }
-
- #endregion
- }
-}
diff --git a/RGB.NET.Devices.Asus_Legacy/AsusDeviceProviderLoader.cs b/RGB.NET.Devices.Asus_Legacy/AsusDeviceProviderLoader.cs
deleted file mode 100644
index 576dfb5..0000000
--- a/RGB.NET.Devices.Asus_Legacy/AsusDeviceProviderLoader.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using RGB.NET.Core;
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- /// Represents a device provider loaded used to dynamically load asus devices into an application.
- ///
- public class AsusDeviceProviderLoader : IRGBDeviceProviderLoader
- {
- #region Properties & Fields
-
- ///
- public bool RequiresInitialization => false;
-
- #endregion
-
- #region Methods
-
- ///
- public IRGBDeviceProvider GetDeviceProvider() => AsusDeviceProvider.Instance;
-
- #endregion
- }
-}
diff --git a/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDevice.cs
deleted file mode 100644
index 6cdc398..0000000
--- a/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDevice.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//using RGB.NET.Core;
-//using RGB.NET.Devices.Asus.Native;
-
-//namespace RGB.NET.Devices.Asus
-//{
-// ///
-// ///
-// /// Represents a Asus dram.
-// ///
-// public class AsusDramRGBDevice : AsusRGBDevice
-// {
-// #region Properties & Fields
-
-// ///
-// /// Gets information about the .
-// ///
-// public AsusDramRGBDeviceInfo DramDeviceInfo { get; }
-
-// #endregion
-
-// #region Constructors
-
-// ///
-// ///
-// /// Initializes a new instance of the class.
-// ///
-// /// The specific information provided by Asus for the DRAM.
-// internal AsusDramRGBDevice(AsusDramRGBDeviceInfo info)
-// : base(info)
-// {
-// this.DramDeviceInfo = info;
-// }
-
-// #endregion
-
-// #region Methods
-
-// ///
-// protected override void InitializeLayout()
-// {
-// //TODO DarthAffe 21.10.2017: Look for a good default layout
-// int ledCount = _AsusSDK.GetGPULedCount(DramDeviceInfo.Handle);
-// for (int i = 0; i < ledCount; i++)
-// InitializeLed(new AsusLedId(this, AsusLedIds.DramLed1 + i, i), new Rectangle(i * 10, 0, 10, 10));
-
-// //TODO DarthAffe 21.10.2017: We don't know the model, how to save layouts and images?
-// ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Drams\{DramDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
-// null, PathHelper.GetAbsolutePath(@"Images\Asus\Drams"));
-// }
-
-// ///
-// protected override void ApplyColorData() => _AsusSDK.SetDramColor(DramDeviceInfo.Handle, ColorData);
-
-// #endregion
-// }
-//}
diff --git a/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDeviceInfo.cs
deleted file mode 100644
index 9f92cac..0000000
--- a/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDeviceInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-using RGB.NET.Core;
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- ///
- /// Represents a generic information for a .
- ///
- public class AsusDramRGBDeviceInfo : AsusRGBDeviceInfo
- {
- #region Properties & Fields
-
- ///
- public override bool SupportsSyncBack => true;
-
- #endregion
-
- #region Constructors
-
- ///
- ///
- /// Internal constructor of managed .
- ///
- /// The type of the .
- /// The handle of the .
- internal AsusDramRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
- : base(deviceType, handle)
- { }
-
- #endregion
- }
-}
diff --git a/RGB.NET.Devices.Asus_Legacy/Enum/AsusLogicalKeyboardLayout.cs b/RGB.NET.Devices.Asus_Legacy/Enum/AsusLogicalKeyboardLayout.cs
deleted file mode 100644
index 60105e5..0000000
--- a/RGB.NET.Devices.Asus_Legacy/Enum/AsusLogicalKeyboardLayout.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// ReSharper disable InconsistentNaming
-// ReSharper disable UnusedMember.Global
-
-#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- /// Contains list of available logical layouts for asus keyboards.
- ///
- public enum AsusLogicalKeyboardLayout
- {
- TODO
- };
-}
diff --git a/RGB.NET.Devices.Asus_Legacy/Enum/AsusPhysicalKeyboardLayout.cs b/RGB.NET.Devices.Asus_Legacy/Enum/AsusPhysicalKeyboardLayout.cs
deleted file mode 100644
index b5e80de..0000000
--- a/RGB.NET.Devices.Asus_Legacy/Enum/AsusPhysicalKeyboardLayout.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// ReSharper disable UnusedMember.Global
-// ReSharper disable InconsistentNaming
-
-#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- /// Contains list of available physical layouts for asus keyboards.
- ///
- public enum AsusPhysicalKeyboardLayout
- {
- TODO
- }
-}
diff --git a/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDevice.cs
deleted file mode 100644
index 011383b..0000000
--- a/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDevice.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using RGB.NET.Core;
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- ///
- ///
- /// Represents a generic Asus-device. (keyboard, mouse, headset, mousepad).
- ///
- public abstract class AsusRGBDevice : AbstractRGBDevice, IAsusRGBDevice
- where TDeviceInfo : AsusRGBDeviceInfo
- {
- #region Properties & Fields
-
- ///
- ///
- /// Gets information about the .
- ///
- public override TDeviceInfo DeviceInfo { get; }
-
- ///
- /// Gets or sets the update queue performing updates for this device.
- ///
- // ReSharper disable once MemberCanBePrivate.Global
- protected AsusUpdateQueue UpdateQueue { get; set; }
-
- #endregion
-
- #region Constructors
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The generic information provided by Asus for the device.
- protected AsusRGBDevice(TDeviceInfo info)
- {
- this.DeviceInfo = info;
- }
-
- #endregion
-
- #region Methods
-
- ///
- /// Initializes the device.
- ///
- public void Initialize(IDeviceUpdateTrigger updateTrigger)
- {
- InitializeLayout();
-
- if (Size == Size.Invalid)
- {
- Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
- Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
- }
-
- UpdateQueue = new AsusUpdateQueue(updateTrigger);
- UpdateQueue.Initialize(GetUpdateColorAction(), DeviceInfo.Handle, LedMapping.Count);
- }
-
- ///
- /// Initializes the and of the device.
- ///
- protected abstract void InitializeLayout();
-
- ///
- protected override void UpdateLeds(IEnumerable ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
-
- ///
- /// Gets a action to update the physical device.
- ///
- ///
- protected abstract Action GetUpdateColorAction();
-
- ///
- ///
- public override void Dispose()
- {
- try { UpdateQueue?.Dispose(); }
- catch { /* at least we tried */ }
-
- if ((DeviceInfo is AsusRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero))
- Marshal.FreeHGlobal(deviceInfo.Handle);
-
- base.Dispose();
- }
-
- #endregion
- }
-}
diff --git a/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDeviceInfo.cs
deleted file mode 100644
index 7c6ff69..0000000
--- a/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDeviceInfo.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using RGB.NET.Core;
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- ///
- /// Represents a generic information for a Corsair-.
- ///
- public abstract class AsusRGBDeviceInfo : IRGBDeviceInfo
- {
- #region Properties & Fields
-
- ///
- public RGBDeviceType DeviceType { get; }
-
- ///
- public string DeviceName { get; }
-
- ///
- public string Manufacturer { get; }
-
- ///
- public string Model { get; }
-
- ///
- public Uri Image { get; set; }
-
- ///
- public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;
-
- ///
- public abstract bool SupportsSyncBack { get; }
-
- ///
- /// Gets the index of the .
- ///
- internal IntPtr Handle { get; }
-
- #endregion
-
- #region Constructors
-
- ///
- /// Internal constructor of managed .
- ///
- /// The type of the .
- /// The handle of the .
- /// The manufacturer-name of the .
- /// The model-name of the .
- internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, string model = "Generic Asus-Device", string manufacturer = "Asus")
- {
- this.DeviceType = deviceType;
- this.Handle = handle;
- this.Model = model;
- this.Manufacturer = manufacturer;
-
- DeviceName = $"{Manufacturer} {Model}";
- }
-
- #endregion
- }
-}
diff --git a/RGB.NET.Devices.Asus_Legacy/Generic/AsusUpdateQueue.cs b/RGB.NET.Devices.Asus_Legacy/Generic/AsusUpdateQueue.cs
deleted file mode 100644
index 28fa936..0000000
--- a/RGB.NET.Devices.Asus_Legacy/Generic/AsusUpdateQueue.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using System;
-using System.Collections.Generic;
-using RGB.NET.Core;
-
-namespace RGB.NET.Devices.Asus
-{
- ///
- ///
- /// Represents the update-queue performing updates for asus devices.
- ///
- public class AsusUpdateQueue : UpdateQueue
- {
- #region Properties & Fields
-
- ///
- /// Gets or sets the internal color-data cache.
- ///
- // ReSharper disable once MemberCanBePrivate.Global
- protected byte[] ColorData { get; private set; }
-
- private Action _updateAction;
- private IntPtr _handle;
-
- #endregion
-
- #region Constructors
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The update trigger used by this queue.
- public AsusUpdateQueue(IDeviceUpdateTrigger updateTrigger)
- : base(updateTrigger)
- { }
-
- #endregion
-
- #region Methods
-
- ///
- /// Initializes the queue.
- ///
- /// The update-action called by the queue to perform updates.
- /// The handle of the device this queue performs updates for.
- /// The amount of leds of the device this queue performs updates for.
- public void Initialize(Action updateAction, IntPtr handle, int ledCount)
- {
- _updateAction = updateAction;
- _handle = handle;
-
- ColorData = new byte[ledCount * 3];
- }
-
- ///
- protected override void Update(Dictionary
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj b/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj
index ba24290..d305ca0 100644
--- a/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj
+++ b/RGB.NET.Devices.Msi/RGB.NET.Devices.Msi.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -61,8 +53,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj b/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj
index abd09fa..9ba1267 100644
--- a/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj
+++ b/RGB.NET.Devices.Novation/RGB.NET.Devices.Novation.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -62,8 +54,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj b/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj
index 7ed66a5..e45df5d 100644
--- a/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj
+++ b/RGB.NET.Devices.Razer/RGB.NET.Devices.Razer.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -61,8 +53,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.Roccat/RGB.NET.Devices.Roccat.csproj b/RGB.NET.Devices.Roccat/RGB.NET.Devices.Roccat.csproj
index f83e1c4..df6d369 100644
--- a/RGB.NET.Devices.Roccat/RGB.NET.Devices.Roccat.csproj
+++ b/RGB.NET.Devices.Roccat/RGB.NET.Devices.Roccat.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -61,8 +53,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.SoIP/RGB.NET.Devices.SoIP.csproj b/RGB.NET.Devices.SoIP/RGB.NET.Devices.SoIP.csproj
index 0816d25..ff30199 100644
--- a/RGB.NET.Devices.SoIP/RGB.NET.Devices.SoIP.csproj
+++ b/RGB.NET.Devices.SoIP/RGB.NET.Devices.SoIP.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -60,7 +52,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers
@@ -70,8 +62,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.SteelSeries/API/Model/CoreProps.cs b/RGB.NET.Devices.SteelSeries/API/Model/CoreProps.cs
index a3f1f85..2fde5f8 100644
--- a/RGB.NET.Devices.SteelSeries/API/Model/CoreProps.cs
+++ b/RGB.NET.Devices.SteelSeries/API/Model/CoreProps.cs
@@ -1,10 +1,10 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace RGB.NET.Devices.SteelSeries.API.Model
{
internal class CoreProps
{
- [JsonProperty(PropertyName = "address")]
+ [JsonPropertyName("address")]
public string Address { get; set; }
}
}
diff --git a/RGB.NET.Devices.SteelSeries/API/Model/Event.cs b/RGB.NET.Devices.SteelSeries/API/Model/Event.cs
index ba3eb60..2e5f043 100644
--- a/RGB.NET.Devices.SteelSeries/API/Model/Event.cs
+++ b/RGB.NET.Devices.SteelSeries/API/Model/Event.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace RGB.NET.Devices.SteelSeries.API.Model
{
@@ -7,13 +7,13 @@ namespace RGB.NET.Devices.SteelSeries.API.Model
{
#region Properties & Fields
- [JsonProperty("game")]
+ [JsonPropertyName("game")]
public string Game { get; set; }
- [JsonProperty("event")]
+ [JsonPropertyName("event")]
public string Name { get; set; }
- [JsonProperty("data")]
+ [JsonPropertyName("data")]
public Dictionary Data { get; } = new Dictionary();
#endregion
diff --git a/RGB.NET.Devices.SteelSeries/API/Model/Game.cs b/RGB.NET.Devices.SteelSeries/API/Model/Game.cs
index d93c7e4..33c62b1 100644
--- a/RGB.NET.Devices.SteelSeries/API/Model/Game.cs
+++ b/RGB.NET.Devices.SteelSeries/API/Model/Game.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace RGB.NET.Devices.SteelSeries.API.Model
{
@@ -6,10 +6,10 @@ namespace RGB.NET.Devices.SteelSeries.API.Model
{
#region Properties & Fields
- [JsonProperty("game")]
+ [JsonPropertyName("game")]
public string Name { get; set; }
- [JsonProperty("game_display_name")]
+ [JsonPropertyName("game_display_name")]
public string DisplayName { get; set; }
#endregion
diff --git a/RGB.NET.Devices.SteelSeries/API/Model/GoLispHandler.cs b/RGB.NET.Devices.SteelSeries/API/Model/GoLispHandler.cs
index 27d5315..f84b4b5 100644
--- a/RGB.NET.Devices.SteelSeries/API/Model/GoLispHandler.cs
+++ b/RGB.NET.Devices.SteelSeries/API/Model/GoLispHandler.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using System.Text.Json.Serialization;
namespace RGB.NET.Devices.SteelSeries.API.Model
{
@@ -6,10 +6,10 @@ namespace RGB.NET.Devices.SteelSeries.API.Model
{
#region Properties & Fields
- [JsonProperty("game")]
+ [JsonPropertyName("game")]
public string Game { get; set; }
- [JsonProperty("golisp")]
+ [JsonPropertyName("golisp")]
public string Handler { get; set; }
#endregion
diff --git a/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs b/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs
index bf82309..012d749 100644
--- a/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs
+++ b/RGB.NET.Devices.SteelSeries/API/SteelSeriesSDK.cs
@@ -5,7 +5,8 @@ using System.Linq;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Text;
-using Newtonsoft.Json;
+using System.Text.Json;
+using System.Text.Json.Serialization;
using RGB.NET.Devices.SteelSeries.API.Model;
namespace RGB.NET.Devices.SteelSeries.API
@@ -73,13 +74,16 @@ namespace RGB.NET.Devices.SteelSeries.API
string corePropsPath = GetCorePropsPath();
if (!string.IsNullOrWhiteSpace(corePropsPath) && File.Exists(corePropsPath))
{
- CoreProps coreProps = JsonConvert.DeserializeObject(File.ReadAllText(corePropsPath));
- _baseUrl = coreProps.Address;
- if (!_baseUrl.StartsWith("http://", StringComparison.Ordinal))
- _baseUrl = "http://" + _baseUrl;
+ CoreProps coreProps = JsonSerializer.Deserialize(File.ReadAllText(corePropsPath));
+ _baseUrl = coreProps?.Address;
+ if (_baseUrl != null)
+ {
+ if (!_baseUrl.StartsWith("http://", StringComparison.Ordinal))
+ _baseUrl = "http://" + _baseUrl;
- RegisterGame(_game);
- RegisterGoLispHandler(new GoLispHandler(_game, HANDLER));
+ RegisterGame(_game);
+ RegisterGoLispHandler(new GoLispHandler(_game, HANDLER));
+ }
}
}
catch
@@ -122,7 +126,7 @@ namespace RGB.NET.Devices.SteelSeries.API
private static string PostJson(string urlSuffix, object o)
{
- string payload = JsonConvert.SerializeObject(o);
+ string payload = JsonSerializer.Serialize(o);
return _client.PostAsync(_baseUrl + urlSuffix, new StringContent(payload, Encoding.UTF8, "application/json")).Result.Content.ReadAsStringAsync().Result;
}
diff --git a/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj b/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj
index bf4b1e5..1543a8c 100644
--- a/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj
+++ b/RGB.NET.Devices.SteelSeries/RGB.NET.Devices.SteelSeries.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,11 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
@@ -56,7 +52,6 @@
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj b/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj
index c8a987d..d6e0eed 100644
--- a/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj
+++ b/RGB.NET.Devices.WS281X/RGB.NET.Devices.WS281X.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -58,16 +50,11 @@
$(DefineConstants);RELEASE
+
+
+
+
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj b/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj
index 4efa935..dfabe58 100644
--- a/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj
+++ b/RGB.NET.Devices.Wooting/RGB.NET.Devices.Wooting.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -61,8 +53,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.Groups/RGB.NET.Groups.csproj b/RGB.NET.Groups/RGB.NET.Groups.csproj
index 59c8c35..a0251a2 100644
--- a/RGB.NET.Groups/RGB.NET.Groups.csproj
+++ b/RGB.NET.Groups/RGB.NET.Groups.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;net45
- win7-x86;win7-x64
+ net5.0
+ latest
+ enable
Darth Affe
Wyrez
@@ -33,15 +34,6 @@
true
True
True
- latest
-
-
-
- NETCORE;NETSTANDARD;NETSTANDARD2_0
-
-
-
- NET45;NETFULL
@@ -61,8 +53,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/RGB.NET.sln b/RGB.NET.sln
index 2d2701e..02cec92 100644
--- a/RGB.NET.sln
+++ b/RGB.NET.sln
@@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presets", "Presets", "{EBC3
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Core", "RGB.NET.Core\RGB.NET.Core.csproj", "{F3ED5768-7251-4347-8D8F-2866313DA658}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Asus_Legacy", "RGB.NET.Devices.Asus_Legacy\RGB.NET.Devices.Asus_Legacy.csproj", "{105FD573-D165-49D1-B8EC-937570616F29}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.CoolerMaster", "RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj", "{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Corsair", "RGB.NET.Devices.Corsair\RGB.NET.Devices.Corsair.csproj", "{BDE3DAD5-75C9-4C50-848D-1E766E916006}"
@@ -59,10 +57,6 @@ Global
{F3ED5768-7251-4347-8D8F-2866313DA658}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3ED5768-7251-4347-8D8F-2866313DA658}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3ED5768-7251-4347-8D8F-2866313DA658}.Release|Any CPU.Build.0 = Release|Any CPU
- {105FD573-D165-49D1-B8EC-937570616F29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {105FD573-D165-49D1-B8EC-937570616F29}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {105FD573-D165-49D1-B8EC-937570616F29}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {105FD573-D165-49D1-B8EC-937570616F29}.Release|Any CPU.Build.0 = Release|Any CPU
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -140,7 +134,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {105FD573-D165-49D1-B8EC-937570616F29} = {D13032C6-432E-4F43-8A32-071133C22B16}
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1} = {D13032C6-432E-4F43-8A32-071133C22B16}
{BDE3DAD5-75C9-4C50-848D-1E766E916006} = {D13032C6-432E-4F43-8A32-071133C22B16}
{8496134D-16F5-43E6-B847-604964B240AD} = {D13032C6-432E-4F43-8A32-071133C22B16}
diff --git a/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj b/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj
index 1a1ca5b..2608e84 100644
--- a/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj
+++ b/Tests/RGB.NET.Core.Tests/RGB.NET.Core.Tests.csproj
@@ -1,15 +1,15 @@
- netcoreapp2.2
+ net5.0
false
-
-
-
+
+
+