From fde6d17bda8cb6f11e893a7231ebe151b381270e Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Tue, 25 Dec 2018 18:55:49 +0100 Subject: [PATCH] Added a method to change the behavior of selecting leds to update in devices --- RGB.NET.Core/Devices/AbstractRGBDevice.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs index 4579c18..0575ca3 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs @@ -86,7 +86,7 @@ namespace RGB.NET.Core DeviceUpdate(); // Send LEDs to SDK - IEnumerable ledsToUpdate = ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)).ToList(); + List ledsToUpdate = GetLedsToUpdate(flushLeds)?.ToList() ?? new List(); foreach (Led ledToUpdate in ledsToUpdate) ledToUpdate.Update(); @@ -94,6 +94,8 @@ namespace RGB.NET.Core UpdateLeds(ledsToUpdate); } + protected virtual IEnumerable GetLedsToUpdate(bool flushLeds) => ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)); + /// public virtual void SyncBack() { }