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>
|
/// </summary>
|
||||||
/// <param name="flushLeds">Specifies whether all <see cref="Led"/>, (including clean ones) should be updated.</param>
|
/// <param name="flushLeds">Specifies whether all <see cref="Led"/>, (including clean ones) should be updated.</param>
|
||||||
public void Update(bool flushLeds = false)
|
public void Update(bool flushLeds = false)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
OnUpdating();
|
OnUpdating();
|
||||||
|
|
||||||
@ -76,18 +78,26 @@ namespace RGB.NET.Core
|
|||||||
{
|
{
|
||||||
// Update effects
|
// Update effects
|
||||||
foreach (ILedGroup ledGroup in _ledGroups)
|
foreach (ILedGroup ledGroup in _ledGroups)
|
||||||
ledGroup.UpdateEffects();
|
try { ledGroup.UpdateEffects(); }
|
||||||
|
catch (Exception ex) { OnException(ex); }
|
||||||
|
|
||||||
// Render brushes
|
// Render brushes
|
||||||
foreach (ILedGroup ledGroup in _ledGroups.OrderBy(x => x.ZIndex))
|
foreach (ILedGroup ledGroup in _ledGroups.OrderBy(x => x.ZIndex))
|
||||||
Render(ledGroup);
|
try { Render(ledGroup); }
|
||||||
|
catch (Exception ex) { OnException(ex); }
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (IRGBDevice device in Devices)
|
foreach (IRGBDevice device in Devices)
|
||||||
device.Update(flushLeds);
|
try { device.Update(flushLeds); }
|
||||||
|
catch (Exception ex) { OnException(ex); }
|
||||||
|
|
||||||
OnUpdated();
|
OnUpdated();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
OnException(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Renders a ledgroup.
|
/// Renders a ledgroup.
|
||||||
@ -100,8 +110,6 @@ namespace RGB.NET.Core
|
|||||||
|
|
||||||
if ((brush == null) || !brush.IsEnabled) return;
|
if ((brush == null) || !brush.IsEnabled) return;
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
switch (brush.BrushCalculationMode)
|
switch (brush.BrushCalculationMode)
|
||||||
{
|
{
|
||||||
case BrushCalculationMode.Relative:
|
case BrushCalculationMode.Relative:
|
||||||
@ -125,12 +133,6 @@ namespace RGB.NET.Core
|
|||||||
foreach (KeyValuePair<BrushRenderTarget, Color> renders in brush.RenderedTargets)
|
foreach (KeyValuePair<BrushRenderTarget, Color> renders in brush.RenderedTargets)
|
||||||
renders.Key.Led.Color = renders.Value;
|
renders.Key.Led.Color = renders.Value;
|
||||||
}
|
}
|
||||||
// ReSharper disable once CatchAllClause
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
OnException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Rectangle GetDeviceLedLocation(Led led, Point extraOffset = null)
|
private Rectangle GetDeviceLedLocation(Led led, Point extraOffset = null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user