mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Fixed wrong exception-handling
This commit is contained in:
parent
993feabd47
commit
9617771368
@ -69,6 +69,8 @@ namespace RGB.NET.Core
|
||||
/// </summary>
|
||||
/// <param name="flushLeds">Specifies whether all <see cref="Led"/>, (including clean ones) should be updated.</param>
|
||||
public void Update(bool flushLeds = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnUpdating();
|
||||
|
||||
@ -76,18 +78,26 @@ namespace RGB.NET.Core
|
||||
{
|
||||
// Update effects
|
||||
foreach (ILedGroup ledGroup in _ledGroups)
|
||||
ledGroup.UpdateEffects();
|
||||
try { ledGroup.UpdateEffects(); }
|
||||
catch (Exception ex) { OnException(ex); }
|
||||
|
||||
// Render brushes
|
||||
foreach (ILedGroup ledGroup in _ledGroups.OrderBy(x => x.ZIndex))
|
||||
Render(ledGroup);
|
||||
try { Render(ledGroup); }
|
||||
catch (Exception ex) { OnException(ex); }
|
||||
}
|
||||
|
||||
foreach (IRGBDevice device in Devices)
|
||||
device.Update(flushLeds);
|
||||
try { device.Update(flushLeds); }
|
||||
catch (Exception ex) { OnException(ex); }
|
||||
|
||||
OnUpdated();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders a ledgroup.
|
||||
@ -100,8 +110,6 @@ namespace RGB.NET.Core
|
||||
|
||||
if ((brush == null) || !brush.IsEnabled) return;
|
||||
|
||||
try
|
||||
{
|
||||
switch (brush.BrushCalculationMode)
|
||||
{
|
||||
case BrushCalculationMode.Relative:
|
||||
@ -125,12 +133,6 @@ namespace RGB.NET.Core
|
||||
foreach (KeyValuePair<BrushRenderTarget, Color> renders in brush.RenderedTargets)
|
||||
renders.Key.Led.Color = renders.Value;
|
||||
}
|
||||
// ReSharper disable once CatchAllClause
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private Rectangle GetDeviceLedLocation(Led led, Point extraOffset = null)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user