diff --git a/Devices/Generic/EventArgs/LedsUpdatedEventArgs.cs b/Devices/Generic/EventArgs/LedsUpdatedEventArgs.cs new file mode 100644 index 0000000..fde5a31 --- /dev/null +++ b/Devices/Generic/EventArgs/LedsUpdatedEventArgs.cs @@ -0,0 +1,24 @@ +// ReSharper disable MemberCanBePrivate.Global + +using System.Collections.Generic; + +namespace CUE.NET.Devices.Generic.EventArgs +{ + public class LedsUpdatedEventArgs : System.EventArgs + { + #region Properties & Fields + + public IEnumerable> UpdatedLeds { get; private set; } + + #endregion + + #region Constructors + + public LedsUpdatedEventArgs(IEnumerable> updatedLeds) + { + this.UpdatedLeds = new List>(updatedLeds); // Copy this - we don't want anyone to change the original led list. + } + + #endregion + } +} diff --git a/Devices/Generic/EventArgs/LedsUpdatingEventArgs.cs b/Devices/Generic/EventArgs/LedsUpdatingEventArgs.cs new file mode 100644 index 0000000..7a05463 --- /dev/null +++ b/Devices/Generic/EventArgs/LedsUpdatingEventArgs.cs @@ -0,0 +1,24 @@ +// ReSharper disable MemberCanBePrivate.Global + +using System.Collections.Generic; + +namespace CUE.NET.Devices.Generic.EventArgs +{ + public class LedsUpdatingEventArgs : System.EventArgs + { + #region Properties & Fields + + public ICollection> UpdatingLeds { get; private set; } + + #endregion + + #region Constructors + + public LedsUpdatingEventArgs(ICollection> updatingLeds) + { + this.UpdatingLeds = updatingLeds; // No copy here - before the update changing this is ok. + } + + #endregion + } +} diff --git a/Devices/Generic/EventArgs/UpdatedEventArgs.cs b/Devices/Generic/EventArgs/UpdatedEventArgs.cs new file mode 100644 index 0000000..a2b2d4b --- /dev/null +++ b/Devices/Generic/EventArgs/UpdatedEventArgs.cs @@ -0,0 +1,5 @@ +namespace CUE.NET.Devices.Generic.EventArgs +{ + public class UpdatedEventArgs : System.EventArgs + { } +} diff --git a/Devices/Generic/EventArgs/UpdatingEventArgs.cs b/Devices/Generic/EventArgs/UpdatingEventArgs.cs new file mode 100644 index 0000000..a8978b3 --- /dev/null +++ b/Devices/Generic/EventArgs/UpdatingEventArgs.cs @@ -0,0 +1,5 @@ +namespace CUE.NET.Devices.Generic.EventArgs +{ + public class UpdatingEventArgs : System.EventArgs + { } +} diff --git a/Devices/Keyboard/CorsairKeyboard.cs b/Devices/Keyboard/CorsairKeyboard.cs index e60abde..8c0c096 100644 --- a/Devices/Keyboard/CorsairKeyboard.cs +++ b/Devices/Keyboard/CorsairKeyboard.cs @@ -146,18 +146,9 @@ namespace CUE.NET.Devices.Keyboard #region Update /// - /// Updates all groups and effects and perform an update for all dirty keys, or all keys if flushLeds is set to true. + /// Updates all brushes on the keyboard and on groups. /// - /// Specifies whether all keys (including clean ones) should be updated. - public override void Update(bool flushLeds = false) - { - UpdateBrushes(); - - // Perform 'real' update - base.Update(flushLeds); - } - - private void UpdateBrushes() + protected override void DeviceUpdate() { if (Brush != null) ApplyBrush(this.ToList(), Brush); @@ -203,7 +194,7 @@ namespace CUE.NET.Devices.Keyboard } } // ReSharper disable once CatchAllClause - catch (Exception ex) { ManageException(ex); } + catch (Exception ex) { OnException(ex); } } public IEnumerable GetLeds() diff --git a/Examples/SimpleDevTest/SimpleDevTest.csproj b/Examples/SimpleDevTest/SimpleDevTest.csproj index 2649844..b053e2f 100644 --- a/Examples/SimpleDevTest/SimpleDevTest.csproj +++ b/Examples/SimpleDevTest/SimpleDevTest.csproj @@ -38,6 +38,7 @@ +