mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Changed device-providers to be disposable
This commit is contained in:
1 parent
1af93658f9
commit
cdace494bc
10 files changed
+58
-20
No files matched your search
@@ -144,19 +144,32 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
public void ResetDevices()
|
||||
{
|
||||
if (IsInitialized)
|
||||
try
|
||||
foreach (IRGBDevice device in Devices)
|
||||
{
|
||||
foreach (IRGBDevice device in Devices)
|
||||
try
|
||||
{
|
||||
CoolerMasterRGBDeviceInfo deviceInfo = (CoolerMasterRGBDeviceInfo)device.DeviceInfo;
|
||||
_CoolerMasterSDK.SetControlDevice(deviceInfo.DeviceIndex);
|
||||
_CoolerMasterSDK.EnableLedControl(false);
|
||||
_CoolerMasterSDK.EnableLedControl(true);
|
||||
}
|
||||
catch {/* shit happens */}
|
||||
}
|
||||
catch
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
if (IsInitialized)
|
||||
foreach (IRGBDevice device in Devices)
|
||||
{
|
||||
// shit happens ...
|
||||
try
|
||||
{
|
||||
CoolerMasterRGBDeviceInfo deviceInfo = (CoolerMasterRGBDeviceInfo)device.DeviceInfo;
|
||||
_CoolerMasterSDK.SetControlDevice(deviceInfo.DeviceIndex);
|
||||
_CoolerMasterSDK.EnableLedControl(false);
|
||||
}
|
||||
catch {/* shit happens */}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user