diff --git a/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs b/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs
index 03410fb..04cfb92 100644
--- a/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs
+++ b/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs
@@ -53,12 +53,12 @@ namespace RGB.NET.Core
}
}
- private AutoResetEvent _hasDataEvent = new AutoResetEvent(false);
+ protected AutoResetEvent HasDataEvent = new AutoResetEvent(false);
- private bool _isRunning;
- private Task _updateTask;
- private CancellationTokenSource _updateTokenSource;
- private CancellationToken _updateToken;
+ protected bool IsRunning;
+ protected Task UpdateTask;
+ protected CancellationTokenSource UpdateTokenSource;
+ protected CancellationToken UpdateToken;
#endregion
@@ -88,13 +88,13 @@ namespace RGB.NET.Core
///
public void Start()
{
- if (_isRunning) return;
+ if (IsRunning) return;
- _isRunning = true;
+ IsRunning = true;
- _updateTokenSource?.Dispose();
- _updateTokenSource = new CancellationTokenSource();
- _updateTask = Task.Factory.StartNew(UpdateLoop, (_updateToken = _updateTokenSource.Token), TaskCreationOptions.LongRunning, TaskScheduler.Default);
+ UpdateTokenSource?.Dispose();
+ UpdateTokenSource = new CancellationTokenSource();
+ UpdateTask = Task.Factory.StartNew(UpdateLoop, (UpdateToken = UpdateTokenSource.Token), TaskCreationOptions.LongRunning, TaskScheduler.Default);
}
///
@@ -102,22 +102,22 @@ namespace RGB.NET.Core
///
public async void Stop()
{
- if (!_isRunning) return;
+ if (!IsRunning) return;
- _isRunning = false;
+ IsRunning = false;
- _updateTokenSource.Cancel();
- await _updateTask;
- _updateTask.Dispose();
- _updateTask = null;
+ UpdateTokenSource.Cancel();
+ await UpdateTask;
+ UpdateTask.Dispose();
+ UpdateTask = null;
}
- private void UpdateLoop()
+ protected virtual void UpdateLoop()
{
OnStartup();
- while (!_updateToken.IsCancellationRequested)
+ while (!UpdateToken.IsCancellationRequested)
{
- if (_hasDataEvent.WaitOne(Timeout))
+ if (HasDataEvent.WaitOne(Timeout))
{
long preUpdateTicks = Stopwatch.GetTimestamp();
@@ -135,7 +135,7 @@ namespace RGB.NET.Core
}
///
- public void TriggerHasData() => _hasDataEvent.Set();
+ public void TriggerHasData() => HasDataEvent.Set();
private void UpdateUpdateFrequency()
{
diff --git a/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs b/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs
index 9b43d5c..fe3d576 100644
--- a/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs
+++ b/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs
@@ -15,6 +15,7 @@ namespace RGB.NET.Devices.SteelSeries
#region Properties & Fields
private string _deviceType;
+ private Dictionary