From b471c0e192c2ae642e115ba439951c8665c28360 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 8 Apr 2018 11:58:10 +0200 Subject: [PATCH] Added missing code documentation --- RGB.NET.Core/Devices/AbstractRGBDevice.cs | 2 +- RGB.NET.Core/Events/UpdatingEventArgs.cs | 10 ++++- RGB.NET.Core/RGBSurface.cs | 11 +++++ RGB.NET.Core/Update/AbstractUpdateTrigger.cs | 11 +++++ RGB.NET.Core/Update/CustomUpdateData.cs | 15 +++++++ .../Update/Devices/DeviceUpdateTrigger.cs | 34 +++++++++++++- .../Update/Devices/IDeviceUpdateTrigger.cs | 6 +++ RGB.NET.Core/Update/Devices/UpdateQueue.cs | 45 +++++++++++++++++-- RGB.NET.Core/Update/IUpdateTrigger.cs | 10 +++++ RGB.NET.Core/Update/TimerUpdateTrigger.cs | 22 +++++++-- RGB.NET.Devices.Asus/AsusDeviceProvider.cs | 3 ++ RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs | 5 ++- .../Generic/AsusUpdateQueue.cs | 18 +++++++- .../CoolerMasterDeviceProvider.cs | 3 ++ .../Generic/CoolerMasterRGBDevice.cs | 4 ++ .../Generic/CoolerMasterUpdateQueue.cs | 9 ++++ .../Native/_CoolerMasterColorMatrix.cs | 4 ++ .../CorsairDeviceProvider.cs | 3 ++ .../Generic/CorsairRGBDevice.cs | 4 ++ .../Generic/CorsairUpdateQueue.cs | 8 ++++ RGB.NET.Devices.DMX/DMXDeviceProvider.cs | 3 ++ RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs | 12 +++++ .../Generic/LogitechRGBDevice.cs | 6 ++- .../Generic/LogitechRGBDeviceInfo.cs | 1 - .../LogitechDeviceProvider.cs | 3 ++ .../PerDevice/LogitechPerDeviceUpdateQueue.cs | 8 ++++ .../PerKey/LogitechPerKeyUpdateQueue.cs | 7 +++ .../Generic/LimitedColorUpdateQueue.cs | 8 ++++ .../Generic/MidiUpdateQueue.cs | 28 +++++++++--- .../Generic/NovationRGBDevice.cs | 4 ++ .../NovationDeviceProvider.cs | 3 ++ .../ChromaLink/RazerChromaLinkUpdateQueue.cs | 8 ++++ .../Generic/RazerRGBDevice.cs | 9 ++++ .../Generic/RazerUpdateQueue.cs | 13 ++++++ .../Headset/RazerHeadsetUpdateQueue.cs | 8 ++++ .../Keyboard/RazerKeyboardUpdateQueue.cs | 8 ++++ .../Keypad/RazerKeypadUpdateQueue.cs | 8 ++++ .../Mouse/RazerMouseUpdateQueue.cs | 8 ++++ .../Mousepad/RazerMousepadUpdateQueue.cs | 8 ++++ RGB.NET.Devices.Razer/RazerDeviceProvider.cs | 3 ++ 40 files changed, 364 insertions(+), 19 deletions(-) diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs index abed2da..fe14e69 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs @@ -14,7 +14,7 @@ namespace RGB.NET.Core /// /// /// - /// Represents a generic RGB-device + /// Represents a generic RGB-device. /// public abstract class AbstractRGBDevice : AbstractBindable, IRGBDevice where TDeviceInfo : class, IRGBDeviceInfo diff --git a/RGB.NET.Core/Events/UpdatingEventArgs.cs b/RGB.NET.Core/Events/UpdatingEventArgs.cs index 42e87cd..46e1f73 100644 --- a/RGB.NET.Core/Events/UpdatingEventArgs.cs +++ b/RGB.NET.Core/Events/UpdatingEventArgs.cs @@ -18,8 +18,14 @@ namespace RGB.NET.Core /// public double DeltaTime { get; } + /// + /// Gets the trigger causing this update. + /// public IUpdateTrigger Trigger { get; } - + + /// + /// Gets the custom-data provided by the trigger for this update. + /// public CustomUpdateData CustomData { get; } #endregion @@ -31,6 +37,8 @@ namespace RGB.NET.Core /// Initializes a new instance of the class. /// /// The elapsed time (in seconds) since the last update. + /// The trigger causing this update. + /// The custom-data provided by the trigger for this update. public UpdatingEventArgs(double deltaTime, IUpdateTrigger trigger, CustomUpdateData customData) { this.DeltaTime = deltaTime; diff --git a/RGB.NET.Core/RGBSurface.cs b/RGB.NET.Core/RGBSurface.cs index 5613d77..c0a4d1a 100644 --- a/RGB.NET.Core/RGBSurface.cs +++ b/RGB.NET.Core/RGBSurface.cs @@ -42,6 +42,9 @@ namespace RGB.NET.Core /// public IEnumerable Devices => new ReadOnlyCollection(_devices); + /// + /// Gets a readonly list containing all registered . + /// public IEnumerable UpdateTriggers => new ReadOnlyCollection(_updateTriggers); /// @@ -249,6 +252,10 @@ namespace RGB.NET.Core public IList GetDevices(RGBDeviceType deviceType) => new ReadOnlyCollection(_devices.Where(x => x.DeviceInfo.DeviceType == deviceType).ToList()); + /// + /// Registers the provided . + /// + /// The to register. public void RegisterUpdateTrigger(IUpdateTrigger updateTrigger) { if (!_updateTriggers.Contains(updateTrigger)) @@ -258,6 +265,10 @@ namespace RGB.NET.Core } } + /// + /// Unregisters the provided . + /// + /// The to unregister. public void UnregisterUpdateTrigger(IUpdateTrigger updateTrigger) { if (_updateTriggers.Remove(updateTrigger)) diff --git a/RGB.NET.Core/Update/AbstractUpdateTrigger.cs b/RGB.NET.Core/Update/AbstractUpdateTrigger.cs index 0769aeb..3ac5d46 100644 --- a/RGB.NET.Core/Update/AbstractUpdateTrigger.cs +++ b/RGB.NET.Core/Update/AbstractUpdateTrigger.cs @@ -2,6 +2,9 @@ namespace RGB.NET.Core { + /// + /// Represents a generic update trigger. + /// public class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger { #region Events @@ -15,8 +18,16 @@ namespace RGB.NET.Core #region Methods + /// + /// Invokes the -event. + /// + /// Optional custom-data passed to the subscribers of the .event. protected virtual void OnStartup(CustomUpdateData updateData = null) => Starting?.Invoke(this, updateData); + /// + /// Invokes the -event. + /// + /// Optional custom-data passed to the subscribers of the .event. protected virtual void OnUpdate(CustomUpdateData updateData = null) => Update?.Invoke(this, updateData); /// diff --git a/RGB.NET.Core/Update/CustomUpdateData.cs b/RGB.NET.Core/Update/CustomUpdateData.cs index a92a182..1e7091c 100644 --- a/RGB.NET.Core/Update/CustomUpdateData.cs +++ b/RGB.NET.Core/Update/CustomUpdateData.cs @@ -2,6 +2,9 @@ namespace RGB.NET.Core { + /// + /// Represents a set of custom data, each indexed by a string-key. + /// public class CustomUpdateData { #region Properties & Fields @@ -12,6 +15,11 @@ namespace RGB.NET.Core #region Indexer + /// + /// Gets or sets the value for a specific key. + /// + /// The key of the value. + /// The value represented by the given key. public object this[string key] { get => _data.TryGetValue(key?.ToUpperInvariant(), out object data) ? data : default; @@ -22,9 +30,16 @@ namespace RGB.NET.Core #region Constructors + /// + /// Initializes a new instance of the class. + /// public CustomUpdateData() { } + /// + /// Initializes a new instance of the class. + /// + /// A params-list of tuples containing the key (string) and the value of a specific custom-data. public CustomUpdateData(params (string key, object value)[] values) { foreach ((string key, object value) in values) diff --git a/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs b/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs index 453ba04..7230926 100644 --- a/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs +++ b/RGB.NET.Core/Update/Devices/DeviceUpdateTrigger.cs @@ -1,18 +1,33 @@ -using System.Diagnostics; +// ReSharper disable MemberCanBePrivate.Global + +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace RGB.NET.Core { + /// + /// Represents an update-trigger used to update devices with a maximum update-rate. + /// public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger { #region Properties & Fields + /// + /// Gets or sets the timeout used by the blocking wait for data availability. + /// public int Timeout { get; set; } = 100; + /// + /// Gets the update frequency used by the trigger if not limited by data shortage. + /// public double UpdateFrequency { get; private set; } private double _maxUpdateRate; + /// + /// Gets or sets the maximum update rate of this trigger (is overwriten if the is smaller). + /// <= 0 removes the limit. + /// public double MaxUpdateRate { get => _maxUpdateRate; @@ -24,6 +39,10 @@ namespace RGB.NET.Core } private double _updateRateHardLimit; + /// + /// Gets the hard limit of the update rate of this trigger. Updates will never perform faster then then this value if it's set. + /// <= 0 removes the limit. + /// public double UpdateRateHardLimit { get => _updateRateHardLimit; @@ -45,9 +64,16 @@ namespace RGB.NET.Core #region Constructors + /// + /// Initializes a new instance of the class. + /// public DeviceUpdateTrigger() { } + /// + /// Initializes a new instance of the class. + /// + /// The hard limit of the update rate of this trigger. public DeviceUpdateTrigger(double updateRateHardLimit) { this._updateRateHardLimit = updateRateHardLimit; @@ -57,6 +83,9 @@ namespace RGB.NET.Core #region Methods + /// + /// Starts the trigger. + /// public void Start() { if (_isRunning) return; @@ -68,6 +97,9 @@ namespace RGB.NET.Core _updateTask = Task.Factory.StartNew(UpdateLoop, (_updateToken = _updateTokenSource.Token), TaskCreationOptions.LongRunning, TaskScheduler.Default); } + /// + /// Stops the trigger. + /// public async void Stop() { if (!_isRunning) return; diff --git a/RGB.NET.Core/Update/Devices/IDeviceUpdateTrigger.cs b/RGB.NET.Core/Update/Devices/IDeviceUpdateTrigger.cs index 1ad117d..81303c1 100644 --- a/RGB.NET.Core/Update/Devices/IDeviceUpdateTrigger.cs +++ b/RGB.NET.Core/Update/Devices/IDeviceUpdateTrigger.cs @@ -1,7 +1,13 @@ namespace RGB.NET.Core { + /// + /// Represents an update trigger used to trigger device-updates. + /// public interface IDeviceUpdateTrigger : IUpdateTrigger { + /// + /// Indicates that there's data available to process. + /// void TriggerHasData(); } } diff --git a/RGB.NET.Core/Update/Devices/UpdateQueue.cs b/RGB.NET.Core/Update/Devices/UpdateQueue.cs index c73eb0e..11660de 100644 --- a/RGB.NET.Core/Update/Devices/UpdateQueue.cs +++ b/RGB.NET.Core/Update/Devices/UpdateQueue.cs @@ -1,9 +1,13 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace RGB.NET.Core { + /// + /// Represents a generic update queue. + /// + /// The type of the key used to identify some data. + /// The type of the data. public abstract class UpdateQueue { #region Properties & Fields @@ -16,11 +20,15 @@ namespace RGB.NET.Core #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The causing this queue to update. public UpdateQueue(IDeviceUpdateTrigger updateTrigger) { this._updateTrigger = updateTrigger; - _updateTrigger.Starting += (sender, args) => OnStartup(); + _updateTrigger.Starting += OnStartup; _updateTrigger.Update += OnUpdate; } @@ -28,6 +36,11 @@ namespace RGB.NET.Core #region Methods + /// + /// Event handler for the -event. + /// + /// The causing this update. + /// provided by the trigger. protected virtual void OnUpdate(object sender, CustomUpdateData customData) { Dictionary dataSet; @@ -41,10 +54,24 @@ namespace RGB.NET.Core Update(dataSet); } - protected virtual void OnStartup() { } + /// + /// Event handler for the -event. + /// + /// The starting . + /// provided by the trigger. + protected virtual void OnStartup(object sender, CustomUpdateData customData) { } + /// + /// Performs the update this queue is responsible for. + /// + /// The set of data that needs to be updated. protected abstract void Update(Dictionary dataSet); + /// + /// Sets or merges the provided data set in the current dataset and notifies the trigger that there is new data available. + /// + /// The set of data. + // ReSharper disable once MemberCanBeProtected.Global public virtual void SetData(Dictionary dataSet) { if ((dataSet == null) || (dataSet.Count == 0)) return; @@ -63,6 +90,9 @@ namespace RGB.NET.Core _updateTrigger.TriggerHasData(); } + /// + /// Resets the current data set. + /// public virtual void Reset() { lock (_dataLock) @@ -72,6 +102,9 @@ namespace RGB.NET.Core #endregion } + /// + /// Represents a generic using an object as the key and a color as the value. + /// public abstract class UpdateQueue : UpdateQueue { #region Constructors @@ -85,6 +118,10 @@ namespace RGB.NET.Core #region Methods + /// + /// Calls for a data set created out of the provided list of . + /// + /// public void SetData(IEnumerable leds) => SetData(leds?.ToDictionary(x => x.CustomData ?? x.Id, x => x.Color)); #endregion diff --git a/RGB.NET.Core/Update/IUpdateTrigger.cs b/RGB.NET.Core/Update/IUpdateTrigger.cs index 693dec1..eed8f3d 100644 --- a/RGB.NET.Core/Update/IUpdateTrigger.cs +++ b/RGB.NET.Core/Update/IUpdateTrigger.cs @@ -2,9 +2,19 @@ namespace RGB.NET.Core { + /// + /// Represents a trigger causing an update. + /// public interface IUpdateTrigger : IDisposable { + /// + /// Occurs when the trigger is starting up. + /// event EventHandler Starting; + + /// + /// Occurs when the trigger wants to cause an update. + /// event EventHandler Update; } } diff --git a/RGB.NET.Core/Update/TimerUpdateTrigger.cs b/RGB.NET.Core/Update/TimerUpdateTrigger.cs index 2a5fa23..996b86f 100644 --- a/RGB.NET.Core/Update/TimerUpdateTrigger.cs +++ b/RGB.NET.Core/Update/TimerUpdateTrigger.cs @@ -1,9 +1,15 @@ -using System.Diagnostics; +// ReSharper disable MemberCanBePrivate.Global + +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace RGB.NET.Core { + /// + /// + /// Represents an + /// public class TimerUpdateTrigger : AbstractUpdateTrigger { #region Properties & Fields @@ -12,7 +18,7 @@ namespace RGB.NET.Core private CancellationToken _updateToken; private Task _updateTask; private Stopwatch _sleepCounter; - + private double _updateFrequency = 1.0 / 30.0; /// /// Gets or sets the update-frequency in seconds. (Calculate by using '1.0 / updates per second') @@ -27,11 +33,15 @@ namespace RGB.NET.Core /// Gets the time it took the last update-loop cycle to run. /// public double LastUpdateTime { get; private set; } - + #endregion #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// A value indicating if the trigger should automatically right after construction. public TimerUpdateTrigger(bool autostart = true) { _sleepCounter = new Stopwatch(); @@ -44,6 +54,9 @@ namespace RGB.NET.Core #region Methods + /// + /// Starts the trigger if needed, causing it to performing updates. + /// public void Start() { if (_updateTask == null) @@ -54,6 +67,9 @@ namespace RGB.NET.Core } } + /// + /// Stops the trigger if running, causing it to stop performing updates. + /// public async void Stop() { if (_updateTask != null) diff --git a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs index bf8da51..4488e7c 100644 --- a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs +++ b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs @@ -63,6 +63,9 @@ namespace RGB.NET.Devices.Asus // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global public Func GetCulture { get; set; } = CultureHelper.GetCurrentCulture; + /// + /// The used to trigger the updates for asus devices. + /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } #endregion diff --git a/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs b/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs index df8d06d..083cafd 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using RGB.NET.Core; -using RGB.NET.Devices.Asus.Generic; namespace RGB.NET.Devices.Asus { @@ -23,6 +22,10 @@ namespace RGB.NET.Devices.Asus /// public override TDeviceInfo DeviceInfo { get; } + /// + /// Gets or sets the update queue performing updates for this device. + /// + // ReSharper disable once MemberCanBePrivate.Global protected AsusUpdateQueue UpdateQueue { get; set; } #endregion diff --git a/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs b/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs index cd4d505..e6d4a6a 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs @@ -2,8 +2,12 @@ using System.Collections.Generic; using RGB.NET.Core; -namespace RGB.NET.Devices.Asus.Generic +namespace RGB.NET.Devices.Asus { + /// + /// + /// Represents the update-queue performing updates for asus devices. + /// public class AsusUpdateQueue : UpdateQueue { #region Properties & Fields @@ -11,6 +15,7 @@ namespace RGB.NET.Devices.Asus.Generic /// /// Gets or sets the internal color-data cache. /// + // ReSharper disable once MemberCanBePrivate.Global protected byte[] ColorData { get; private set; } private Action _updateAction; @@ -20,6 +25,10 @@ namespace RGB.NET.Devices.Asus.Generic #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. public AsusUpdateQueue(IDeviceUpdateTrigger updateTrigger) : base(updateTrigger) { } @@ -28,6 +37,12 @@ namespace RGB.NET.Devices.Asus.Generic #region Methods + /// + /// Initializes the queue. + /// + /// The update-action called by the queue to perform updates. + /// The handle of the device this queue performs updates for. + /// The amount of leds of the device this queue performs updates for. public void Initialize(Action updateAction, IntPtr handle, int ledCount) { _updateAction = updateAction; @@ -36,6 +51,7 @@ namespace RGB.NET.Devices.Asus.Generic ColorData = new byte[ledCount * 3]; } + /// protected override void Update(Dictionary dataSet) { foreach (KeyValuePair data in dataSet) diff --git a/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs b/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs index 25c6daa..95c3e20 100644 --- a/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs +++ b/RGB.NET.Devices.CoolerMaster/CoolerMasterDeviceProvider.cs @@ -63,6 +63,9 @@ namespace RGB.NET.Devices.CoolerMaster // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global public Func GetCulture { get; set; } = CultureHelper.GetCurrentCulture; + /// + /// The used to trigger the updates for cooler master devices. + /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } #endregion diff --git a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs index f6d40e8..01747d2 100644 --- a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs +++ b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterRGBDevice.cs @@ -22,6 +22,10 @@ namespace RGB.NET.Devices.CoolerMaster /// public override TDeviceInfo DeviceInfo { get; } + /// + /// Gets or sets the update queue performing updates for this device. + /// + // ReSharper disable once MemberCanBePrivate.Global protected CoolerMasterUpdateQueue UpdateQueue { get; set; } #endregion diff --git a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs index 8469620..1296d87 100644 --- a/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs +++ b/RGB.NET.Devices.CoolerMaster/Generic/CoolerMasterUpdateQueue.cs @@ -4,6 +4,10 @@ using RGB.NET.Devices.CoolerMaster.Native; namespace RGB.NET.Devices.CoolerMaster { + /// + /// + /// Represents the update-queue performing updates for cooler master devices. + /// public class CoolerMasterUpdateQueue : UpdateQueue { #region Properties & Fields @@ -14,6 +18,11 @@ namespace RGB.NET.Devices.CoolerMaster #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + /// The of the device this queue performs updates for. public CoolerMasterUpdateQueue(IDeviceUpdateTrigger updateTrigger, CoolerMasterDevicesIndexes deviceIndex) : base(updateTrigger) { diff --git a/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterColorMatrix.cs b/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterColorMatrix.cs index c30f706..524c909 100644 --- a/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterColorMatrix.cs +++ b/RGB.NET.Devices.CoolerMaster/Native/_CoolerMasterColorMatrix.cs @@ -7,9 +7,13 @@ namespace RGB.NET.Devices.CoolerMaster.Native { #region Constants + // ReSharper disable MemberCanBePrivate.Global + internal const int ROWS = 6; internal const int COLUMNS = 22; + // ReSharper restore MemberCanBePrivate.Global + #endregion #region Properties & Fields diff --git a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs index 442493a..708f6b5 100644 --- a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs +++ b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs @@ -66,6 +66,9 @@ namespace RGB.NET.Devices.Corsair /// public IEnumerable Devices { get; private set; } + /// + /// The used to trigger the updates for corsair devices. + /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } private CorsairUpdateQueue _updateQueue; diff --git a/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs b/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs index 6a96811..4c098b1 100644 --- a/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Generic/CorsairRGBDevice.cs @@ -29,6 +29,10 @@ namespace RGB.NET.Devices.Corsair // ReSharper disable once MemberCanBePrivate.Global protected Dictionary InternalLedMapping { get; } = new Dictionary(); + /// + /// Gets or sets the update queue performing updates for this device. + /// + // ReSharper disable once MemberCanBePrivate.Global protected CorsairUpdateQueue UpdateQueue { get; set; } #endregion diff --git a/RGB.NET.Devices.Corsair/Generic/CorsairUpdateQueue.cs b/RGB.NET.Devices.Corsair/Generic/CorsairUpdateQueue.cs index ab71e60..fbdee50 100644 --- a/RGB.NET.Devices.Corsair/Generic/CorsairUpdateQueue.cs +++ b/RGB.NET.Devices.Corsair/Generic/CorsairUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Corsair.Native; namespace RGB.NET.Devices.Corsair { + /// + /// + /// Represents the update-queue performing updates for corsair devices. + /// public class CorsairUpdateQueue : UpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. public CorsairUpdateQueue(IDeviceUpdateTrigger updateTrigger) : base(updateTrigger) { } diff --git a/RGB.NET.Devices.DMX/DMXDeviceProvider.cs b/RGB.NET.Devices.DMX/DMXDeviceProvider.cs index 1320530..3e7d889 100644 --- a/RGB.NET.Devices.DMX/DMXDeviceProvider.cs +++ b/RGB.NET.Devices.DMX/DMXDeviceProvider.cs @@ -37,6 +37,9 @@ namespace RGB.NET.Devices.DMX /// public List DeviceDefinitions { get; } = new List(); + /// + /// The used to trigger the updates for dmx devices. + /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } #endregion diff --git a/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs b/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs index adc4dd8..dcf301e 100644 --- a/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs +++ b/RGB.NET.Devices.DMX/E131/E131UpdateQueue.cs @@ -5,6 +5,10 @@ using RGB.NET.Core; namespace RGB.NET.Devices.DMX.E131 { + /// + /// + /// Represents the update-queue performing updates for E131-DMX devices. + /// public class E131UpdateQueue : UpdateQueue { #region Properties & Fields @@ -29,6 +33,13 @@ namespace RGB.NET.Devices.DMX.E131 #region Constructors + /// + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + /// The hostname of the device this queue is performing updates for. + /// The port to connect to the device this queue is performing updates for. public E131UpdateQueue(IDeviceUpdateTrigger updateTrigger, string hostname, int port) : base(updateTrigger) { @@ -40,6 +51,7 @@ namespace RGB.NET.Devices.DMX.E131 #region Methods + /// protected override void Update(Dictionary dataSet) { DataPacket.SetSequenceNumber(GetNextSequenceNumber()); diff --git a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs index db0d96c..edcbd29 100644 --- a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs +++ b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDevice.cs @@ -18,7 +18,11 @@ namespace RGB.NET.Devices.Logitech /// Gets information about the . /// public override TDeviceInfo DeviceInfo { get; } - + + /// + /// Gets or sets the update queue performing updates for this device. + /// + // ReSharper disable once MemberCanBePrivate.Global protected UpdateQueue UpdateQueue { get; set; } #endregion diff --git a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs index 1aebbe1..3fc5017 100644 --- a/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Logitech/Generic/LogitechRGBDeviceInfo.cs @@ -66,7 +66,6 @@ namespace RGB.NET.Devices.Logitech /// The type of the . /// The represented device model. /// The lighting-capabilities of the device. - /// The base of the image path used to load device-images. /// The layout used to decide which images to load. /// The path/name of the layout-file. internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps, diff --git a/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs b/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs index 706d01c..817665f 100644 --- a/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs +++ b/RGB.NET.Devices.Logitech/LogitechDeviceProvider.cs @@ -56,6 +56,9 @@ namespace RGB.NET.Devices.Logitech /// public Func GetCulture { get; set; } = CultureHelper.GetCurrentCulture; + /// + /// The used to trigger the updates for logitech devices. + /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } private LogitechPerDeviceUpdateQueue _perDeviceUpdateQueue; private LogitechPerKeyUpdateQueue _perKeyUpdateQueue; diff --git a/RGB.NET.Devices.Logitech/PerDevice/LogitechPerDeviceUpdateQueue.cs b/RGB.NET.Devices.Logitech/PerDevice/LogitechPerDeviceUpdateQueue.cs index 04d8820..23e1b69 100644 --- a/RGB.NET.Devices.Logitech/PerDevice/LogitechPerDeviceUpdateQueue.cs +++ b/RGB.NET.Devices.Logitech/PerDevice/LogitechPerDeviceUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Logitech.Native; namespace RGB.NET.Devices.Logitech { + /// + /// + /// Represents the update-queue performing updates for logitech per-device devices. + /// public class LogitechPerDeviceUpdateQueue : UpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. public LogitechPerDeviceUpdateQueue(IDeviceUpdateTrigger updateTrigger) : base(updateTrigger) { } diff --git a/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs b/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs index 3701cb1..02f7dd0 100644 --- a/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs +++ b/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs @@ -5,6 +5,9 @@ using RGB.NET.Devices.Logitech.Native; namespace RGB.NET.Devices.Logitech { + /// + /// Represents the update-queue performing updates for logitech per-key devices. + /// public class LogitechPerKeyUpdateQueue : UpdateQueue { #region Properties & Fields @@ -15,6 +18,10 @@ namespace RGB.NET.Devices.Logitech #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. public LogitechPerKeyUpdateQueue(IDeviceUpdateTrigger updateTrigger) : base(updateTrigger) { diff --git a/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs b/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs index 62f4284..65460e2 100644 --- a/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs +++ b/RGB.NET.Devices.Novation/Generic/LimitedColorUpdateQueue.cs @@ -5,10 +5,18 @@ using Sanford.Multimedia.Midi; namespace RGB.NET.Devices.Novation { + /// + /// Represents the update-queue performing updates for a limited-color novation device. + /// public class LimitedColorUpdateQueue : MidiUpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + /// The device-id of the device this queue is performing updates for. public LimitedColorUpdateQueue(IDeviceUpdateTrigger updateTrigger, int deviceId) : base(updateTrigger, deviceId) { } diff --git a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs index 3a8ee36..4dfafc9 100644 --- a/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs +++ b/RGB.NET.Devices.Novation/Generic/MidiUpdateQueue.cs @@ -5,6 +5,11 @@ using Sanford.Multimedia.Midi; namespace RGB.NET.Devices.Novation { + /// + /// + /// + /// Represents the update-queue performing updates for midi devices. + /// public abstract class MidiUpdateQueue : UpdateQueue, IDisposable { #region Properties & Fields @@ -15,7 +20,13 @@ namespace RGB.NET.Devices.Novation #region Constructors - public MidiUpdateQueue(IDeviceUpdateTrigger updateTrigger, int deviceId) + /// + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + /// The id of the device this queue is performing updates for. + protected MidiUpdateQueue(IDeviceUpdateTrigger updateTrigger, int deviceId) : base(updateTrigger) { _outputDevice = new OutputDevice(deviceId); @@ -32,14 +43,21 @@ namespace RGB.NET.Devices.Novation SendMessage(CreateMessage(data)); } + /// + /// Sends the specified message to the device this queue is performing updates for. + /// + /// The message to send. protected virtual void SendMessage(ShortMessage message) => _outputDevice.SendShort(message.Message); + /// + /// Creates a update-message out of a given data set. + /// + /// The data set to create the message from. + /// The message created out of the data set. protected abstract ShortMessage CreateMessage(KeyValuePair data); - public void Dispose() - { - _outputDevice.Dispose(); - } + /// + public void Dispose() => _outputDevice.Dispose(); #endregion } diff --git a/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs b/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs index f5a6cd6..c1904eb 100644 --- a/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs +++ b/RGB.NET.Devices.Novation/Generic/NovationRGBDevice.cs @@ -21,6 +21,10 @@ namespace RGB.NET.Devices.Novation /// public override TDeviceInfo DeviceInfo { get; } + /// + /// The used to update this . + /// + // ReSharper disable once MemberCanBePrivate.Global protected MidiUpdateQueue UpdateQueue { get; set; } #endregion diff --git a/RGB.NET.Devices.Novation/NovationDeviceProvider.cs b/RGB.NET.Devices.Novation/NovationDeviceProvider.cs index aeae69a..5ad614f 100644 --- a/RGB.NET.Devices.Novation/NovationDeviceProvider.cs +++ b/RGB.NET.Devices.Novation/NovationDeviceProvider.cs @@ -39,6 +39,9 @@ namespace RGB.NET.Devices.Novation /// public IEnumerable Devices { get; private set; } + /// + /// The used to trigger the updates for novation devices. + /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } #endregion diff --git a/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkUpdateQueue.cs b/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkUpdateQueue.cs index eb1ba84..a9ade2b 100644 --- a/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkUpdateQueue.cs +++ b/RGB.NET.Devices.Razer/ChromaLink/RazerChromaLinkUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Represents the update-queue performing updates for razer chroma-link devices. + /// public class RazerChromaLinkUpdateQueue : RazerUpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used to update this queue. + /// The id of the device updated by this queue. public RazerChromaLinkUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId) : base(updateTrigger, deviceId) { } diff --git a/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs b/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs index 54e59ab..525dd58 100644 --- a/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs +++ b/RGB.NET.Devices.Razer/Generic/RazerRGBDevice.cs @@ -20,6 +20,10 @@ namespace RGB.NET.Devices.Razer /// public override TDeviceInfo DeviceInfo { get; } + /// + /// Gets or sets the update queue performing updates for this device. + /// + // ReSharper disable once MemberCanBePrivate.Global protected RazerUpdateQueue UpdateQueue { get; set; } #endregion @@ -57,6 +61,11 @@ namespace RGB.NET.Devices.Razer UpdateQueue = CreateUpdateQueue(updateTrigger); } + /// + /// Creates a specific for this device. + /// + /// The trigger used to update the queue. + /// The for this device. protected abstract RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger); /// diff --git a/RGB.NET.Devices.Razer/Generic/RazerUpdateQueue.cs b/RGB.NET.Devices.Razer/Generic/RazerUpdateQueue.cs index 4dec4e4..de99795 100644 --- a/RGB.NET.Devices.Razer/Generic/RazerUpdateQueue.cs +++ b/RGB.NET.Devices.Razer/Generic/RazerUpdateQueue.cs @@ -5,6 +5,9 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Represents a basic update-queue performing updates for razer devices. + /// public abstract class RazerUpdateQueue : UpdateQueue { #region Properties & Fields @@ -16,6 +19,11 @@ namespace RGB.NET.Devices.Razer #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used to update this queue. + /// The id of the device updated by this queue. protected RazerUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId) : base(updateTrigger) { @@ -41,6 +49,11 @@ namespace RGB.NET.Devices.Razer _lastEffect = effectId; } + /// + /// Creates the effect used to update this device. + /// + /// The parameters of the effect. + /// The id this effect is created with. protected virtual void CreateEffect(IntPtr effectParams, ref Guid effectId) => _RazerSDK.CreateEffect(_deviceId, _Defines.EFFECT_ID, effectParams, ref effectId); /// diff --git a/RGB.NET.Devices.Razer/Headset/RazerHeadsetUpdateQueue.cs b/RGB.NET.Devices.Razer/Headset/RazerHeadsetUpdateQueue.cs index 2a12cb2..91563e1 100644 --- a/RGB.NET.Devices.Razer/Headset/RazerHeadsetUpdateQueue.cs +++ b/RGB.NET.Devices.Razer/Headset/RazerHeadsetUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Represents the update-queue performing updates for razer headset devices. + /// public class RazerHeadsetUpdateQueue : RazerUpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used to update this queue. + /// The id of the device updated by this queue. public RazerHeadsetUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId) : base(updateTrigger, deviceId) { } diff --git a/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardUpdateQueue.cs b/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardUpdateQueue.cs index 323c520..16db3a9 100644 --- a/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardUpdateQueue.cs +++ b/RGB.NET.Devices.Razer/Keyboard/RazerKeyboardUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Represents the update-queue performing updates for razer keyboard devices. + /// public class RazerKeyboardUpdateQueue : RazerUpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used to update this queue. + /// The id of the device updated by this queue. public RazerKeyboardUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId) : base(updateTrigger, deviceId) { } diff --git a/RGB.NET.Devices.Razer/Keypad/RazerKeypadUpdateQueue.cs b/RGB.NET.Devices.Razer/Keypad/RazerKeypadUpdateQueue.cs index 0f4afa0..2efd757 100644 --- a/RGB.NET.Devices.Razer/Keypad/RazerKeypadUpdateQueue.cs +++ b/RGB.NET.Devices.Razer/Keypad/RazerKeypadUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Represents the update-queue performing updates for razer keypad devices. + /// public class RazerKeypadUpdateQueue : RazerUpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used to update this queue. + /// The id of the device updated by this queue. public RazerKeypadUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId) : base(updateTrigger, deviceId) { } diff --git a/RGB.NET.Devices.Razer/Mouse/RazerMouseUpdateQueue.cs b/RGB.NET.Devices.Razer/Mouse/RazerMouseUpdateQueue.cs index 2dfde03..f1b039d 100644 --- a/RGB.NET.Devices.Razer/Mouse/RazerMouseUpdateQueue.cs +++ b/RGB.NET.Devices.Razer/Mouse/RazerMouseUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Represents the update-queue performing updates for razer mouse devices. + /// public class RazerMouseUpdateQueue : RazerUpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used to update this queue. + /// The id of the device updated by this queue. public RazerMouseUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId) : base(updateTrigger, deviceId) { } diff --git a/RGB.NET.Devices.Razer/Mousepad/RazerMousepadUpdateQueue.cs b/RGB.NET.Devices.Razer/Mousepad/RazerMousepadUpdateQueue.cs index 47150c1..6e81117 100644 --- a/RGB.NET.Devices.Razer/Mousepad/RazerMousepadUpdateQueue.cs +++ b/RGB.NET.Devices.Razer/Mousepad/RazerMousepadUpdateQueue.cs @@ -6,10 +6,18 @@ using RGB.NET.Devices.Razer.Native; namespace RGB.NET.Devices.Razer { + /// + /// Represents the update-queue performing updates for razer mousepad devices. + /// public class RazerMousepadUpdateQueue : RazerUpdateQueue { #region Constructors + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used to update this queue. + /// The id of the device updated by this queue. public RazerMousepadUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId) : base(updateTrigger, deviceId) { } diff --git a/RGB.NET.Devices.Razer/RazerDeviceProvider.cs b/RGB.NET.Devices.Razer/RazerDeviceProvider.cs index 0023295..5c9f88b 100644 --- a/RGB.NET.Devices.Razer/RazerDeviceProvider.cs +++ b/RGB.NET.Devices.Razer/RazerDeviceProvider.cs @@ -68,6 +68,9 @@ namespace RGB.NET.Devices.Razer /// public bool LoadEmulatorDevices { get; set; } = false; + /// + /// The used to trigger the updates for razer devices. + /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } #endregion