mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
Changed all device-providers to load as much devices as possible without throwing exceptions
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user