1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00

Added a method to change the behavior of selecting leds to update in devices

This commit is contained in:
Darth Affe 2018-12-25 18:55:49 +01:00
parent 5a0d5ff104
commit fde6d17bda

View File

@ -86,7 +86,7 @@ namespace RGB.NET.Core
DeviceUpdate();
// Send LEDs to SDK
IEnumerable<Led> ledsToUpdate = ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)).ToList();
List<Led> ledsToUpdate = GetLedsToUpdate(flushLeds)?.ToList() ?? new List<Led>();
foreach (Led ledToUpdate in ledsToUpdate)
ledToUpdate.Update();
@ -94,6 +94,8 @@ namespace RGB.NET.Core
UpdateLeds(ledsToUpdate);
}
protected virtual IEnumerable<Led> GetLedsToUpdate(bool flushLeds) => ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty));
/// <inheritdoc />
public virtual void SyncBack()
{ }