Added exception-handling to all UpdateQueues

This commit is contained in:
DarthAffe committed 2023-03-05 16:34:01 +01:00
1 parent 6e313ea6a1
commit 37e4954583
18 files changed
+222 -97

No files matched your search

@@ -39,13 +39,20 @@ public class CoolerMasterUpdateQueue : UpdateQueue
/// <inheritdoc />
protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet)
{
foreach ((object key, Color color) in dataSet)
try
{
(int row, int column) = ((int, int))key;
_deviceMatrix.KeyColor[row, column] = new _CoolerMasterKeyColor(color.GetR(), color.GetG(), color.GetB());
}
foreach ((object key, Color color) in dataSet)
{
(int row, int column) = ((int, int))key;
_deviceMatrix.KeyColor[row, column] = new _CoolerMasterKeyColor(color.GetR(), color.GetG(), color.GetB());
}
_CoolerMasterSDK.SetAllLedColor(_deviceMatrix, _deviceIndex);
_CoolerMasterSDK.SetAllLedColor(_deviceMatrix, _deviceIndex);
}
catch (Exception ex)
{
CoolerMasterDeviceProvider.Instance.Throw(ex, true);
}
}
#endregion