1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 16:58:29 +00:00

Added missing comments

This commit is contained in:
Darth Affe 2016-08-21 20:06:02 +02:00
parent 8d32c73b6d
commit 0fc32243c8
12 changed files with 92 additions and 2 deletions

View File

@ -74,6 +74,7 @@ namespace CUE.NET.Brushes
foreach (BrushRenderTarget point in renderTargets)
RenderedTargets[point] = GetColorAtPoint(rectangle, point);
}
/// <summary>
/// Performs the finalize pass of the brush and calculates the final colors for all previously calculated points.
/// </summary>

View File

@ -6,18 +6,32 @@ using CUE.NET.Devices.Keyboard.Enums;
namespace CUE.NET.Brushes
{
/// <summary>
/// Represents a single target of a brush render.
/// </summary>
public class BrushRenderTarget
{
#region Properties & Fields
/// <summary>
/// Gets the id of the target-key.
/// </summary>
public CorsairKeyboardKeyId Key { get; }
/// <summary>
/// Gets the point representing the position to render the target-key.
/// </summary>
public PointF Point { get; }
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="BrushRenderTarget"/> class.
/// </summary>
/// <param name="key">The id of the target-key.</param>
/// <param name="point">The point representing the position to render the target-key.</param>
public BrushRenderTarget(CorsairKeyboardKeyId key, PointF point)
{
this.Point = point;

View File

@ -39,6 +39,9 @@ namespace CUE.NET.Brushes
#region Properties & Fields
/// <summary>
/// Gets the strongly-typed target used for the effect.
/// </summary>
protected override IBrush EffectTarget => this;
/// <summary>

View File

@ -18,6 +18,9 @@ namespace CUE.NET.Brushes
{
#region Properties & Fields
/// <summary>
/// Gets the strongly-typed target used for the effect.
/// </summary>
protected override IBrush EffectTarget => this;
/// <summary>

View File

@ -12,6 +12,9 @@ namespace CUE.NET.Brushes
{
#region Properties & Fields
/// <summary>
/// Gets the strongly-typed target used for the effect.
/// </summary>
protected override IBrush EffectTarget => this;
private Dictionary<CorsairKeyboardKeyId, Color> _keyLights;

View File

@ -16,6 +16,9 @@ namespace CUE.NET.Brushes
{
#region Properties & Fields
/// <summary>
/// Gets the strongly-typed target used for the effect.
/// </summary>
protected override IBrush EffectTarget => this;
/// <summary>

View File

@ -15,6 +15,9 @@ namespace CUE.NET.Brushes
{
#region Properties & Fields
/// <summary>
/// Gets the strongly-typed target used for the effect.
/// </summary>
protected override IBrush EffectTarget => this;
private Random _random = new Random();

View File

@ -12,6 +12,9 @@ namespace CUE.NET.Brushes
{
#region Properties & Fields
/// <summary>
/// Gets the strongly-typed target used for the effect.
/// </summary>
protected override IBrush EffectTarget => this;
/// <summary>

View File

@ -5,18 +5,32 @@ using System.Drawing;
namespace CUE.NET.Devices.Generic
{
/// <summary>
/// Represents a request to update a led.
/// </summary>
public class LedUpateRequest
{
#region Properties & Fields
/// <summary>
/// Gets the id of the led to update.
/// </summary>
public int LedId { get; }
/// <summary>
/// Gets the requested color of the led.
/// </summary>
public Color Color { get; set; }
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="LedUpateRequest"/> class.
/// </summary>
/// <param name="ledId">The id of the led to update.</param>
/// <param name="color">The requested color of the led.</param>
public LedUpateRequest(int ledId, Color color)
{
this.LedId = ledId;

View File

@ -181,7 +181,11 @@ namespace CUE.NET.Devices.Keyboard
// ReSharper disable once CatchAllClause
catch (Exception ex) { OnException(ex); }
}
/// <summary>
/// Gets a list containing all LEDs of this group.
/// </summary>
/// <returns>The list containing all LEDs of this group.</returns>
public IEnumerable<CorsairLed> GetLeds()
{
return this.Select(x => x.Led);
@ -242,16 +246,27 @@ namespace CUE.NET.Devices.Keyboard
#region Effects
/// <summary>
/// NOT IMPLEMENTED: Effects can't be applied directly to the keyboard. Add it to the Brush or create a keygroup instead.
/// </summary>
public void UpdateEffects()
{
throw new NotSupportedException("Effects can't be applied directly to the keyboard. Add it to the Brush or create a keygroup instead.");
}
/// <summary>
/// NOT IMPLEMENTED: Effects can't be applied directly to the keyboard. Add it to the Brush or create a keygroup instead.
/// </summary>
/// <param name="effect">The effect to add.</param>
public void AddEffect(IEffect<IKeyGroup> effect)
{
throw new NotSupportedException("Effects can't be applied directly to the keyboard. Add it to the Brush or create a keygroup instead.");
}
/// <summary>
/// NOT IMPLEMENTED: Effects can't be applied directly to the keyboard. Add it to the Brush or create a keygroup instead.
/// </summary>
/// <param name="effect">The effect to remove.</param>
public void RemoveEffect(IEffect<IKeyGroup> effect)
{
throw new NotSupportedException("Effects can't be applied directly to the keyboard. Add it to the Brush or create a keygroup instead.");
@ -270,6 +285,10 @@ namespace CUE.NET.Devices.Keyboard
return _keys.Values.GetEnumerator();
}
/// <summary>
/// Returns an enumerator that iterates over all keys of the keyboard.
/// </summary>
/// <returns>An enumerator for all keys of the keyboard.</returns>
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();

View File

@ -6,19 +6,34 @@ using System.Linq;
namespace CUE.NET.Effects
{
/// <summary>
/// Represents an generic effect-target.
/// </summary>
/// <typeparam name="T"></typeparam>
public abstract class AbstractEffectTarget<T> : IEffectTarget<T>
where T : IEffectTarget<T>
{
#region Properties & Fields
private IList<EffectTimeContainer> _effectTimes = new List<EffectTimeContainer>();
/// <summary>
/// Gets all <see cref="IEffect{T}" /> attached to this target.
/// </summary>
protected IList<IEffect<T>> Effects => _effectTimes.Select(x => x.Effect).Cast<IEffect<T>>().ToList();
/// <summary>
/// Gets the strongly-typed target used for the effect.
/// </summary>
protected abstract T EffectTarget { get; }
#endregion
#region Methods
/// <summary>
/// Updates all effects added to this target.
/// </summary>
public void UpdateEffects()
{
lock (Effects)
@ -47,6 +62,10 @@ namespace CUE.NET.Effects
}
}
/// <summary>
/// Adds an affect.
/// </summary>
/// <param name="effect">The effect to add.</param>
public void AddEffect(IEffect<T> effect)
{
if (_effectTimes.All(x => x.Effect != effect))
@ -56,6 +75,10 @@ namespace CUE.NET.Effects
}
}
/// <summary>
/// Removes an effect
/// </summary>
/// <param name="effect">The effect to remove.</param>
public void RemoveEffect(IEffect<T> effect)
{
EffectTimeContainer effectTimeToRemove = _effectTimes.FirstOrDefault(x => x.Effect == effect);

View File

@ -1,4 +1,5 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
using CUE.NET.Devices.Keyboard.Keys;