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

@@ -27,12 +27,19 @@ public class LogitechPerDeviceUpdateQueue : UpdateQueue
/// <inheritdoc />
protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet)
{
Color color = dataSet[0].color;
try
{
Color color = dataSet[0].color;
_LogitechGSDK.LogiLedSetTargetDevice(LogitechDeviceCaps.DeviceRGB);
_LogitechGSDK.LogiLedSetLighting((int)Math.Round(color.R * 100),
(int)Math.Round(color.G * 100),
(int)Math.Round(color.B * 100));
_LogitechGSDK.LogiLedSetTargetDevice(LogitechDeviceCaps.DeviceRGB);
_LogitechGSDK.LogiLedSetLighting((int)Math.Round(color.R * 100),
(int)Math.Round(color.G * 100),
(int)Math.Round(color.B * 100));
}
catch (Exception ex)
{
LogitechDeviceProvider.Instance.Throw(ex, true);
}
}
#endregion