Added a device filter to LoadDevices and device Initialize

This commit is contained in:
DarthAffe committed 2017-12-07 12:24:14 +01:00
1 parent b700c84b8d
commit 11ca959328
9 files changed
+142 -114

No files matched your search

@@ -82,7 +82,7 @@ namespace RGB.NET.Devices.CoolerMaster
#region Methods
/// <inheritdoc />
public bool Initialize(bool exclusiveAccessIfPossible = false, bool throwExceptions = false)
public bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool exclusiveAccessIfPossible = false, bool throwExceptions = false)
{
IsInitialized = false;
@@ -101,8 +101,11 @@ namespace RGB.NET.Devices.CoolerMaster
_CoolerMasterSDK.SetControlDevice(index);
if (_CoolerMasterSDK.IsDevicePlugged())
{
RGBDeviceType deviceType = index.GetDeviceType();
if (!loadFilter.HasFlag(deviceType)) continue;
ICoolerMasterRGBDevice device;
switch (index.GetDeviceType())
switch (deviceType)
{
case RGBDeviceType.Keyboard:
CoolerMasterPhysicalKeyboardLayout physicalLayout = _CoolerMasterSDK.GetDeviceLayout();