Changed all device-providers to load as much devices as possible without throwing exceptions

This commit is contained in:
DarthAffe committed 2017-11-19 21:20:23 +01:00
1 parent 800a9c2e72
commit 338936d42f
6 files changed
+190 -196

No files matched your search

@@ -95,10 +95,11 @@ namespace RGB.NET.Devices.CoolerMaster
foreach (CoolerMasterDevicesIndexes index in Enum.GetValues(typeof(CoolerMasterDevicesIndexes)))
{
_CoolerMasterSDK.SetControlDevice(index);
if (_CoolerMasterSDK.IsDevicePlugged())
try
{
try
_CoolerMasterSDK.SetControlDevice(index);
if (_CoolerMasterSDK.IsDevicePlugged())
{
CoolerMasterRGBDevice device;
switch (index.GetDeviceType())
@@ -119,28 +120,20 @@ namespace RGB.NET.Devices.CoolerMaster
device.Initialize();
devices.Add(device);
}
catch
{
if (throwExceptions)
throw;
else
continue;
}
}
catch { if (throwExceptions) throw; }
}
Devices = new ReadOnlyCollection<IRGBDevice>(devices);
IsInitialized = true;
}
catch
{
if (throwExceptions)
throw;
else
return false;
return false;
}
IsInitialized = true;
return true;
}