mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Fixed some code issues
This commit is contained in:
parent
2086b3729d
commit
8e212190ae
@ -10,6 +10,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing a conical gradient.
|
||||
/// </summary>
|
||||
@ -27,6 +28,7 @@ namespace RGB.NET.Brushes
|
||||
/// </summary>
|
||||
public Point Center { get; set; } = new Point(0.5, 0.5);
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets or sets the gradient drawn by the brush. If null it will default to full transparent.
|
||||
/// </summary>
|
||||
@ -36,38 +38,42 @@ namespace RGB.NET.Brushes
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConicalGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.ConicalGradientBrush" /> class.
|
||||
/// </summary>
|
||||
public ConicalGradientBrush()
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConicalGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.ConicalGradientBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="gradient">The <see cref="IGradient"/> drawn by this <see cref="ConicalGradientBrush"/>.</param>
|
||||
/// <param name="gradient">The <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> drawn by this <see cref="T:RGB.NET.Brushes.ConicalGradientBrush" />.</param>
|
||||
public ConicalGradientBrush(IGradient gradient)
|
||||
{
|
||||
this.Gradient = gradient;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConicalGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.ConicalGradientBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="center">The center <see cref="Point"/> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="gradient">The <see cref="IGradient"/> drawn by this <see cref="ConicalGradientBrush"/>.</param>
|
||||
/// <param name="center">The center <see cref="T:RGB.NET.Core.Point" /> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="gradient">The <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> drawn by this <see cref="T:RGB.NET.Brushes.ConicalGradientBrush" />.</param>
|
||||
public ConicalGradientBrush(Point center, IGradient gradient)
|
||||
{
|
||||
this.Center = center;
|
||||
this.Gradient = gradient;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConicalGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.ConicalGradientBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="center">The center <see cref="Point"/> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="origin">The origin (radian-angle) the <see cref="IBrush"/> is drawn to.</param>
|
||||
/// <param name="gradient">The <see cref="IGradient"/> drawn by this <see cref="ConicalGradientBrush"/>.</param>
|
||||
/// <param name="center">The center <see cref="T:RGB.NET.Core.Point" /> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="origin">The origin (radian-angle) the <see cref="T:RGB.NET.Core.IBrush" /> is drawn to.</param>
|
||||
/// <param name="gradient">The <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> drawn by this <see cref="T:RGB.NET.Brushes.ConicalGradientBrush" />.</param>
|
||||
public ConicalGradientBrush(Point center, float origin, IGradient gradient)
|
||||
{
|
||||
this.Center = center;
|
||||
|
||||
@ -3,6 +3,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic gradient-brush.
|
||||
/// </summary>
|
||||
|
||||
@ -11,6 +11,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing a linear gradient.
|
||||
/// </summary>
|
||||
@ -35,26 +36,29 @@ namespace RGB.NET.Brushes
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LinearGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.LinearGradientBrush" /> class.
|
||||
/// </summary>
|
||||
public LinearGradientBrush()
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LinearGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.LinearGradientBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="gradient">The <see cref="IGradient"/> drawn by this <see cref="LinearGradientBrush"/>.</param>
|
||||
/// <param name="gradient">The <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> drawn by this <see cref="T:RGB.NET.Brushes.LinearGradientBrush" />.</param>
|
||||
public LinearGradientBrush(IGradient gradient)
|
||||
{
|
||||
this.Gradient = gradient;
|
||||
}
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LinearGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.LinearGradientBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="startPoint">The start <see cref="Point"/> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="endPoint">The end <see cref="Point"/> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="gradient">The <see cref="IGradient"/> drawn by this <see cref="LinearGradientBrush"/>.</param>
|
||||
/// <param name="startPoint">The start <see cref="T:RGB.NET.Core.Point" /> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="endPoint">The end <see cref="T:RGB.NET.Core.Point" /> (as percentage in the range [0..1]).</param>
|
||||
/// <param name="gradient">The <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> drawn by this <see cref="T:RGB.NET.Brushes.LinearGradientBrush" />.</param>
|
||||
public LinearGradientBrush(Point startPoint, Point endPoint, IGradient gradient)
|
||||
{
|
||||
this.StartPoint = startPoint;
|
||||
@ -66,6 +70,7 @@ namespace RGB.NET.Brushes
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets the color at an specific point assuming the brush is drawn into the given rectangle.
|
||||
/// </summary>
|
||||
|
||||
@ -9,6 +9,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing a radial gradient around a center point.
|
||||
/// </summary>
|
||||
@ -28,14 +29,16 @@ namespace RGB.NET.Brushes
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RadialGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.RadialGradientBrush" /> class.
|
||||
/// </summary>
|
||||
public RadialGradientBrush()
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RadialGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.RadialGradientBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="gradient">The gradient drawn by the brush.</param>
|
||||
public RadialGradientBrush(IGradient gradient)
|
||||
@ -43,8 +46,9 @@ namespace RGB.NET.Brushes
|
||||
this.Gradient = gradient;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RadialGradientBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.RadialGradientBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="center">The center point (as percentage in the range [0..1]).</param>
|
||||
/// <param name="gradient">The gradient drawn by the brush.</param>
|
||||
|
||||
@ -5,6 +5,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing only a single color.
|
||||
/// </summary>
|
||||
@ -21,10 +22,11 @@ namespace RGB.NET.Brushes
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SolidColorBrush"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.SolidColorBrush" /> class.
|
||||
/// </summary>
|
||||
/// <param name="color">The <see cref="Color"/> drawn by this <see cref="SolidColorBrush"/>.</param>
|
||||
/// <param name="color">The <see cref="P:RGB.NET.Brushes.SolidColorBrush.Color" /> drawn by this <see cref="T:RGB.NET.Brushes.SolidColorBrush" />.</param>
|
||||
public SolidColorBrush(Color color)
|
||||
{
|
||||
this.Color = color;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
using RGB.NET.Brushes.Gradients;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decorator decorating a <see cref="IGradient"/>.
|
||||
/// Represents a basic decorator decorating a <see cref="T:RGB.NET.Brushes.Gradients.IGradient" />.
|
||||
/// </summary>
|
||||
public interface IGradientDecorator : IDecorator
|
||||
{ }
|
||||
|
||||
@ -8,6 +8,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes.Gradients
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic gradient.
|
||||
/// </summary>
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace RGB.NET.Brushes.Gradients
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic gradient.
|
||||
/// </summary>
|
||||
|
||||
@ -6,6 +6,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes.Gradients
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a linear interpolated gradient with n stops.
|
||||
/// </summary>
|
||||
@ -13,24 +14,27 @@ namespace RGB.NET.Brushes.Gradients
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LinearGradient"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.Gradients.LinearGradient" /> class.
|
||||
/// </summary>
|
||||
public LinearGradient()
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LinearGradient"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.Gradients.LinearGradient" /> class.
|
||||
/// </summary>
|
||||
/// <param name="gradientStops">The stops with which the gradient should be initialized.</param>
|
||||
public LinearGradient(params GradientStop[] gradientStops)
|
||||
: base(gradientStops)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AbstractGradient"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Brushes.Gradients.AbstractGradient" /> class.
|
||||
/// </summary>
|
||||
/// <param name="wrapGradient">Specifies whether the gradient should wrapp or not (see <see cref="AbstractGradient.WrapGradient"/> for an example of what this means).</param>
|
||||
/// <param name="wrapGradient">Specifies whether the gradient should wrapp or not (see <see cref="P:RGB.NET.Brushes.Gradients.AbstractGradient.WrapGradient" /> for an example of what this means).</param>
|
||||
/// <param name="gradientStops">The stops with which the gradient should be initialized.</param>
|
||||
public LinearGradient(bool wrapGradient, params GradientStop[] gradientStops)
|
||||
: base(wrapGradient, gradientStops)
|
||||
@ -40,11 +44,12 @@ namespace RGB.NET.Brushes.Gradients
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets the linear interpolated <see cref="Color"/> at the given offset.
|
||||
/// Gets the linear interpolated <see cref="T:RGB.NET.Core.Color" /> at the given offset.
|
||||
/// </summary>
|
||||
/// <param name="offset">The percentage offset to take the color from.</param>
|
||||
/// <returns>The <see cref="Color"/> at the specific offset.</returns>
|
||||
/// <returns>The <see cref="T:RGB.NET.Core.Color" /> at the specific offset.</returns>
|
||||
public override Color GetColor(double offset)
|
||||
{
|
||||
if (GradientStops.Count == 0) return Color.Transparent;
|
||||
|
||||
@ -5,6 +5,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Brushes.Gradients
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a rainbow gradient which circles through all colors of the HUE-color-space.<br />
|
||||
/// See <see href="http://upload.wikimedia.org/wikipedia/commons/a/ad/HueScale.svg" /> as reference.
|
||||
@ -42,6 +43,7 @@ namespace RGB.NET.Brushes.Gradients
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets the color on the rainbow at the given offset.
|
||||
/// </summary>
|
||||
|
||||
@ -2,12 +2,12 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable VirtualMemberNeverOverridden.Global
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic brush.
|
||||
/// </summary>
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decorator which is aware of the <see cref="RGBSurface.Updating"/> event.
|
||||
/// Represents a basic decorator which is aware of the <see cref="E:RGB.NET.Core.RGBSurface.Updating" /> event.
|
||||
/// </summary>
|
||||
public abstract class AbstractUpdateAwareDecorator : AbstractDecorator
|
||||
{
|
||||
@ -20,7 +21,7 @@
|
||||
/// Initializes a new instance of the <see cref="AbstractUpdateAwareDecorator"/> class.
|
||||
/// </summary>
|
||||
/// <param name="updateIfDisabled">Bool indicating if the <see cref="AbstractUpdateAwareDecorator"/> should call <see cref="Update"/> even if the Decorator is disabled.</param>
|
||||
public AbstractUpdateAwareDecorator(bool updateIfDisabled = false)
|
||||
protected AbstractUpdateAwareDecorator(bool updateIfDisabled = false)
|
||||
{
|
||||
this.UpdateIfDisabled = updateIfDisabled;
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decorator decorating a <see cref="ILedGroup"/>.
|
||||
/// Represents a basic decorator decorating a <see cref="T:RGB.NET.Core.ILedGroup" />.
|
||||
/// </summary>
|
||||
public interface ILedGroupDecorator : IDecorator
|
||||
{ }
|
||||
|
||||
@ -8,6 +8,7 @@ using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device
|
||||
/// </summary>
|
||||
@ -57,14 +58,7 @@ namespace RGB.NET.Core
|
||||
#region Indexer
|
||||
|
||||
/// <inheritdoc />
|
||||
Led IRGBDevice.this[ILedId ledId]
|
||||
{
|
||||
get
|
||||
{
|
||||
Led led;
|
||||
return LedMapping.TryGetValue(ledId, out led) ? led : null;
|
||||
}
|
||||
}
|
||||
Led IRGBDevice.this[ILedId ledId] => LedMapping.TryGetValue(ledId, out Led led) ? led : null;
|
||||
|
||||
/// <inheritdoc />
|
||||
Led IRGBDevice.this[Point location] => LedMapping.Values.FirstOrDefault(x => x.LedRectangle.Contains(location));
|
||||
@ -138,19 +132,21 @@ namespace RGB.NET.Core
|
||||
|
||||
#region Enumerator
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates over all <see cref="Led"/> of the <see cref="IRGBDevice"/>.
|
||||
/// Returns an enumerator that iterates over all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
/// <returns>An enumerator for all <see cref="Led"/> of the <see cref="IRGBDevice"/>.</returns>
|
||||
/// <returns>An enumerator for all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</returns>
|
||||
public IEnumerator<Led> GetEnumerator()
|
||||
{
|
||||
return LedMapping.Values.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates over all <see cref="Led"/> of the <see cref="IRGBDevice"/>.
|
||||
/// Returns an enumerator that iterates over all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
/// <returns>An enumerator for all <see cref="Led"/> of the <see cref="IRGBDevice"/>.</returns>
|
||||
/// <returns>An enumerator for all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</returns>
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
|
||||
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device
|
||||
/// </summary>
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a special part of a <see cref="IRGBDevice"/>.
|
||||
/// Represents a special part of a <see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public interface IRGBDeviceSpecialPart : IEnumerable<Led>
|
||||
{ }
|
||||
|
||||
@ -107,8 +107,7 @@ namespace RGB.NET.Core.Layout
|
||||
/// <param name="lastLed">The <see cref="LedLayout"/> previously calculated.</param>
|
||||
public void CalculateValues(DeviceLayout device, LedLayout lastLed)
|
||||
{
|
||||
Shape shape;
|
||||
if (!Enum.TryParse(DescriptiveShape, true, out shape))
|
||||
if (!Enum.TryParse(DescriptiveShape, true, out Shape shape))
|
||||
{
|
||||
shape = Shape.Custom;
|
||||
ShapeData = DescriptiveShape;
|
||||
|
||||
@ -5,8 +5,9 @@ using System;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="RGBSurface.Exception"/>-event.
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Exception" />-event.
|
||||
/// </summary>
|
||||
public class ExceptionEventArgs : EventArgs
|
||||
{
|
||||
@ -21,10 +22,11 @@ namespace RGB.NET.Core
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ExceptionEventArgs"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.ExceptionEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="exception">The <see cref="System.Exception"/> which is responsible for the event-call.</param>
|
||||
/// <param name="exception">The <see cref="T:System.Exception" /> which is responsible for the event-call.</param>
|
||||
public ExceptionEventArgs(Exception exception)
|
||||
{
|
||||
this.Exception = exception;
|
||||
|
||||
@ -6,8 +6,9 @@ using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="RGBSurface.SurfaceLayoutChanged"/>-event.
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.SurfaceLayoutChanged" />-event.
|
||||
/// </summary>
|
||||
public class SurfaceLayoutChangedEventArgs : EventArgs
|
||||
{
|
||||
@ -32,12 +33,13 @@ namespace RGB.NET.Core
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SurfaceLayoutChangedEventArgs"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.SurfaceLayoutChangedEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="devices">The <see cref="IRGBDevice"/> that caused the change.</param>
|
||||
/// <param name="deviceAdded">A value indicating if the event is caused by the addition of a new <see cref="IRGBDevice"/> to the <see cref="RGBSurface"/>.</param>
|
||||
/// <param name="deviceLocationChanged">A value indicating if the event is caused by a changed location of one of the devices on the <see cref="RGBSurface"/>.</param>
|
||||
/// <param name="devices">The <see cref="T:RGB.NET.Core.IRGBDevice" /> that caused the change.</param>
|
||||
/// <param name="deviceAdded">A value indicating if the event is caused by the addition of a new <see cref="T:RGB.NET.Core.IRGBDevice" /> to the <see cref="T:RGB.NET.Core.RGBSurface" />.</param>
|
||||
/// <param name="deviceLocationChanged">A value indicating if the event is caused by a changed location of one of the devices on the <see cref="T:RGB.NET.Core.RGBSurface" />.</param>
|
||||
public SurfaceLayoutChangedEventArgs(IEnumerable<IRGBDevice> devices, bool deviceAdded, bool deviceLocationChanged)
|
||||
{
|
||||
this.Devices = devices;
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="RGBSurface.Updated"/>-event.
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Updated" />-event.
|
||||
/// </summary>
|
||||
public class UpdatedEventArgs : EventArgs
|
||||
{ }
|
||||
|
||||
@ -5,8 +5,9 @@ using System;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="RGBSurface.Updating"/>-event.
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Updating" />-event.
|
||||
/// </summary>
|
||||
public class UpdatingEventArgs : EventArgs
|
||||
{
|
||||
@ -21,8 +22,9 @@ namespace RGB.NET.Core
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UpdatingEventArgs"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.UpdatingEventArgs" /> class.
|
||||
/// </summary>
|
||||
/// <param name="deltaTime">The elapsed time (in seconds) since the last update.</param>
|
||||
public UpdatingEventArgs(double deltaTime)
|
||||
|
||||
@ -2,15 +2,17 @@
|
||||
|
||||
namespace RGB.NET.Core.Exceptions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by an <see cref="IRGBDevice"/>.
|
||||
/// Represents an exception thrown by an <see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class RGBDeviceException : ApplicationException
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RGBDeviceException"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Exceptions.RGBDeviceException" /> class.
|
||||
/// </summary>
|
||||
/// <param name="message">The message which describes the reason of throwing this exception.</param>
|
||||
/// <param name="innerException">Optional inner exception, which lead to this exception.</param>
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic <see cref="AbstractLedGroup"/>.
|
||||
/// Represents a generic <see cref="T:RGB.NET.Core.AbstractLedGroup" />.
|
||||
/// </summary>
|
||||
public abstract class AbstractLedGroup : AbstractDecoratable<ILedGroupDecorator>, ILedGroup
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic ledgroup.
|
||||
/// </summary>
|
||||
|
||||
@ -6,6 +6,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an ARGB (alpha, red, green, blue) color.
|
||||
/// </summary>
|
||||
@ -184,21 +185,23 @@ namespace RGB.NET.Core
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Color"/> class.
|
||||
/// The class created by this constructor equals <see cref="Transparent"/>.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Color" /> class.
|
||||
/// The class created by this constructor equals <see cref="P:RGB.NET.Core.Color.Transparent" />.
|
||||
/// </summary>
|
||||
public Color()
|
||||
: this(0, 0, 0, 0)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Color"/> class using only RGB-Values.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Color" /> class using only RGB-Values.
|
||||
/// Alpha defaults to 255.
|
||||
/// </summary>
|
||||
/// <param name="r">The red component value of this <see cref="Color"/>.</param>
|
||||
/// <param name="g">The green component value of this <see cref="Color"/>.</param>
|
||||
/// <param name="b">The blue component value of this <see cref="Color"/>.</param>
|
||||
/// <param name="r">The red component value of this <see cref="T:RGB.NET.Core.Color" />.</param>
|
||||
/// <param name="g">The green component value of this <see cref="T:RGB.NET.Core.Color" />.</param>
|
||||
/// <param name="b">The blue component value of this <see cref="T:RGB.NET.Core.Color" />.</param>
|
||||
public Color(byte r, byte g, byte b)
|
||||
: this(255, r, g, b)
|
||||
{ }
|
||||
@ -218,13 +221,14 @@ namespace RGB.NET.Core
|
||||
this.B = b;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Color"/> class using only RGB-Values.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Color" /> class using only RGB-Values.
|
||||
/// Alpha defaults to 255.
|
||||
/// </summary>
|
||||
/// <param name="hue">The hue component value of this <see cref="Color"/>.</param>
|
||||
/// <param name="saturation">The saturation component value of this <see cref="Color"/>.</param>
|
||||
/// <param name="value">The value component value of this <see cref="Color"/>.</param>
|
||||
/// <param name="hue">The hue component value of this <see cref="T:RGB.NET.Core.Color" />.</param>
|
||||
/// <param name="saturation">The saturation component value of this <see cref="T:RGB.NET.Core.Color" />.</param>
|
||||
/// <param name="value">The value component value of this <see cref="T:RGB.NET.Core.Color" />.</param>
|
||||
public Color(double hue, double saturation, double value)
|
||||
: this(255, hue, saturation, value)
|
||||
{ }
|
||||
@ -254,10 +258,11 @@ namespace RGB.NET.Core
|
||||
UpdateRGBFromHSV();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Color"/> class by cloning a existing <see cref="Color"/>.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Color" /> class by cloning a existing <see cref="T:RGB.NET.Core.Color" />.
|
||||
/// </summary>
|
||||
/// <param name="color">The <see cref="Color"/> the values are copied from.</param>
|
||||
/// <param name="color">The <see cref="T:RGB.NET.Core.Color" /> the values are copied from.</param>
|
||||
public Color(Color color)
|
||||
: this(color.A, color.R, color.G, color.B)
|
||||
{ }
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a single LED of a RGB-device.
|
||||
/// </summary>
|
||||
|
||||
@ -3,6 +3,7 @@ using System.Runtime.CompilerServices;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic bindable class which notifies when a property value changes.
|
||||
/// </summary>
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a point consisting of a X- and a Y-position.
|
||||
/// </summary>
|
||||
|
||||
@ -9,6 +9,7 @@ using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a rectangle defined by it's position and it's size.
|
||||
/// </summary>
|
||||
@ -77,6 +78,7 @@ namespace RGB.NET.Core
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
// ReSharper disable EventNeverSubscribedTo.Global
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a the <see cref="Location"/> of the <see cref="Rectangle"/> changes.
|
||||
@ -93,24 +95,27 @@ namespace RGB.NET.Core
|
||||
/// </summary>
|
||||
public event EventHandler Changed;
|
||||
|
||||
// ReSharper restore EventNeverSubscribedTo.Global
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Rectangle"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Rectangle" /> class.
|
||||
/// </summary>
|
||||
public Rectangle()
|
||||
: this(new Point(), new Size())
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Rectangle"/> class using the provided values for <see cref="Location"/> ans <see cref="Size"/>.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Rectangle" /> class using the provided values for <see cref="P:RGB.NET.Core.Rectangle.Location" /> ans <see cref="P:RGB.NET.Core.Rectangle.Size" />.
|
||||
/// </summary>
|
||||
/// <param name="x">The <see cref="Point.X"/>-position of this <see cref="Rectangle"/>.</param>
|
||||
/// <param name="y">The <see cref="Point.Y"/>-position of this <see cref="Rectangle"/>.</param>
|
||||
/// <param name="width">The <see cref="Core.Size.Width"/> of this <see cref="Rectangle"/>.</param>
|
||||
/// <param name="height">The <see cref="Core.Size.Height"/> of this <see cref="Rectangle"/>.</param>
|
||||
/// <param name="x">The <see cref="P:RGB.NET.Core.Point.X" />-position of this <see cref="T:RGB.NET.Core.Rectangle" />.</param>
|
||||
/// <param name="y">The <see cref="P:RGB.NET.Core.Point.Y" />-position of this <see cref="T:RGB.NET.Core.Rectangle" />.</param>
|
||||
/// <param name="width">The <see cref="P:RGB.NET.Core.Size.Width" /> of this <see cref="T:RGB.NET.Core.Rectangle" />.</param>
|
||||
/// <param name="height">The <see cref="P:RGB.NET.Core.Size.Height" /> of this <see cref="T:RGB.NET.Core.Rectangle" />.</param>
|
||||
public Rectangle(double x, double y, double width, double height)
|
||||
: this(new Point(x, y), new Size(width, height))
|
||||
{ }
|
||||
@ -126,11 +131,12 @@ namespace RGB.NET.Core
|
||||
this.Size = size;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Rectangle"/> class using the given array of <see cref="Rectangle"/>.
|
||||
/// The <see cref="Location"/> and <see cref="Size"/> is calculated to completely contain all rectangles provided as parameters.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Rectangle" /> class using the given array of <see cref="T:RGB.NET.Core.Rectangle" />.
|
||||
/// The <see cref="P:RGB.NET.Core.Rectangle.Location" /> and <see cref="P:RGB.NET.Core.Rectangle.Size" /> is calculated to completely contain all rectangles provided as parameters.
|
||||
/// </summary>
|
||||
/// <param name="rectangles">The array of <see cref="Rectangle"/> used to calculate the <see cref="Location"/> and <see cref="Size"/></param>
|
||||
/// <param name="rectangles">The array of <see cref="T:RGB.NET.Core.Rectangle" /> used to calculate the <see cref="P:RGB.NET.Core.Rectangle.Location" /> and <see cref="P:RGB.NET.Core.Rectangle.Size" /></param>
|
||||
public Rectangle(params Rectangle[] rectangles)
|
||||
: this(rectangles.AsEnumerable())
|
||||
{ }
|
||||
@ -164,20 +170,22 @@ namespace RGB.NET.Core
|
||||
InitializeFromPoints(new Point(0, 0), new Point(0, 0));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Rectangle"/> class using the given array of <see cref="Point"/>.
|
||||
/// The <see cref="Location"/> and <see cref="Size"/> is calculated to contain all points provided as parameters.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Rectangle" /> class using the given array of <see cref="T:RGB.NET.Core.Point" />.
|
||||
/// The <see cref="P:RGB.NET.Core.Rectangle.Location" /> and <see cref="P:RGB.NET.Core.Rectangle.Size" /> is calculated to contain all points provided as parameters.
|
||||
/// </summary>
|
||||
/// <param name="points">The array of <see cref="Point"/> used to calculate the <see cref="Location"/> and <see cref="Size"/></param>
|
||||
/// <param name="points">The array of <see cref="T:RGB.NET.Core.Point" /> used to calculate the <see cref="P:RGB.NET.Core.Rectangle.Location" /> and <see cref="P:RGB.NET.Core.Rectangle.Size" /></param>
|
||||
public Rectangle(params Point[] points)
|
||||
: this(points.AsEnumerable())
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Rectangle"/> class using the given list of <see cref="Point"/>.
|
||||
/// The <see cref="Location"/> and <see cref="Size"/> is calculated to contain all points provided as parameters.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Rectangle" /> class using the given list of <see cref="T:RGB.NET.Core.Point" />.
|
||||
/// The <see cref="P:RGB.NET.Core.Rectangle.Location" /> and <see cref="P:RGB.NET.Core.Rectangle.Size" /> is calculated to contain all points provided as parameters.
|
||||
/// </summary>
|
||||
/// <param name="points">The list of <see cref="Point"/> used to calculate the <see cref="Location"/> and <see cref="Size"/></param>
|
||||
/// <param name="points">The list of <see cref="T:RGB.NET.Core.Point" /> used to calculate the <see cref="P:RGB.NET.Core.Rectangle.Location" /> and <see cref="P:RGB.NET.Core.Rectangle.Size" /></param>
|
||||
public Rectangle(IEnumerable<Point> points)
|
||||
: this()
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a size consisting of a width and a height.
|
||||
/// </summary>
|
||||
@ -43,10 +44,11 @@ namespace RGB.NET.Core
|
||||
public Size()
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Size"/> using the provided size to define a square.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Core.Size" /> using the provided size to define a square.
|
||||
/// </summary>
|
||||
/// <param name="size">The size used for the <see cref="Width"/> component value and the <see cref="Height"/> component value.</param>
|
||||
/// <param name="size">The size used for the <see cref="P:RGB.NET.Core.Size.Width" /> component value and the <see cref="P:RGB.NET.Core.Size.Height" /> component value.</param>
|
||||
public Size(double size)
|
||||
: this(size, size)
|
||||
{ }
|
||||
|
||||
@ -8,6 +8,7 @@ using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a RGB-surface containing multiple devices.
|
||||
/// </summary>
|
||||
|
||||
@ -7,6 +7,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Decorators.Brush
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a decorator which allows to flash a brush by modifying his opacity.
|
||||
/// </summary>
|
||||
|
||||
@ -4,8 +4,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Decorators.Gradient
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a decorator which allows to move an <see cref="IGradient"/> by modifying his offset.
|
||||
/// Represents a decorator which allows to move an <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> by modifying his offset.
|
||||
/// </summary>
|
||||
public class MoveGradientDecorator : AbstractUpdateAwareDecorator, IGradientDecorator
|
||||
{
|
||||
@ -33,14 +34,15 @@ namespace RGB.NET.Decorators.Gradient
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MoveGradientDecorator"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Decorators.Gradient.MoveGradientDecorator" /> class.
|
||||
/// </summary>
|
||||
/// <param name="speed">The speed of the movement in units per second.
|
||||
/// The meaning of units differs for the different <see cref="IGradient"/> but 360 units will always be one complete cycle:
|
||||
/// <see cref="LinearGradient"/>: 360 unit = 1 offset.
|
||||
/// <see cref="RainbowGradient"/>: 1 unit = 1 degree.</param>
|
||||
/// <param name="direction">The direction the <see cref="IGradient"/> is moved.
|
||||
/// The meaning of units differs for the different <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> but 360 units will always be one complete cycle:
|
||||
/// <see cref="T:RGB.NET.Brushes.Gradients.LinearGradient" />: 360 unit = 1 offset.
|
||||
/// <see cref="T:RGB.NET.Brushes.Gradients.RainbowGradient" />: 1 unit = 1 degree.</param>
|
||||
/// <param name="direction">The direction the <see cref="T:RGB.NET.Brushes.Gradients.IGradient" /> is moved.
|
||||
/// True leads to an offset-increment (normaly moving to the right), false to an offset-decrement (normaly moving to the left).</param>
|
||||
public MoveGradientDecorator(double speed = 180.0, bool direction = true)
|
||||
{
|
||||
|
||||
@ -1,16 +1,15 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("RGB.NET.Decorators")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyDescription("Decorator-Presets of RGB.NET")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCompany("Wyrez")]
|
||||
[assembly: AssemblyProduct("RGB.NET.Decorators")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyCopyright("Copyright © Wyrez 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster.Attributes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Specifies the <see cref="RGBDeviceType"/> of a field.
|
||||
/// Specifies the <see cref="T:RGB.NET.Core.RGBDeviceType" /> of a field.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class DeviceTypeAttribute : Attribute
|
||||
@ -20,10 +21,11 @@ namespace RGB.NET.Devices.CoolerMaster.Attributes
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of the <see cref="DeviceTypeAttribute"/> class.
|
||||
/// Internal constructor of the <see cref="T:RGB.NET.Devices.CoolerMaster.Attributes.DeviceTypeAttribute" /> class.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The <see cref="RGBDeviceType"/>.</param>
|
||||
/// <param name="deviceType">The <see cref="T:RGB.NET.Core.RGBDeviceType" />.</param>
|
||||
public DeviceTypeAttribute(RGBDeviceType deviceType)
|
||||
{
|
||||
this.DeviceType = deviceType;
|
||||
|
||||
@ -12,6 +12,7 @@ using RGB.NET.Devices.CoolerMaster.Native;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for Cooler Master devices.
|
||||
/// </summary>
|
||||
@ -37,6 +38,7 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
/// </summary>
|
||||
public static List<string> PossibleX64NativePaths { get; } = new List<string> { "x64/CMSDK.dll" };
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Indicates if the SDK is initialized and ready to use.
|
||||
/// </summary>
|
||||
@ -47,6 +49,7 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
/// </summary>
|
||||
public string LoadedArchitecture => _CoolerMasterSDK.LoadedArchitecture;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets whether the application has exclusive access to the SDK or not.
|
||||
/// </summary>
|
||||
@ -58,7 +61,7 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
/// <summary>
|
||||
/// Gets or sets a function to get the culture for a specific device.
|
||||
/// </summary>
|
||||
public Func<CultureInfo> GetCulture { get; set; } = () => CultureHelper.GetCurrentCulture();
|
||||
public Func<CultureInfo> GetCulture { get; set; } = CultureHelper.GetCurrentCulture;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -97,7 +100,7 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
try
|
||||
{
|
||||
CoolerMasterRGBDevice device = null;
|
||||
CoolerMasterRGBDevice device;
|
||||
switch (index.GetDeviceType())
|
||||
{
|
||||
case RGBDeviceType.Keyboard:
|
||||
|
||||
@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a Id of a <see cref="Led"/> on a <see cref="CoolerMasterRGBDevice"/>.
|
||||
/// Represents a Id of a <see cref="T:RGB.NET.Core.Led" /> on a <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterRGBDevice" />.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{" + nameof(LedId) + "}")]
|
||||
public class CoolerMasterLedId : ILedId
|
||||
|
||||
@ -8,14 +8,16 @@ using RGB.NET.Devices.CoolerMaster.Native;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic CoolerMaster-device. (keyboard, mouse, headset, mousepad).
|
||||
/// </summary>
|
||||
public abstract class CoolerMasterRGBDevice : AbstractRGBDevice
|
||||
{
|
||||
#region Properties & Fields
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets information about the <see cref="CoolerMasterRGBDevice"/>.
|
||||
/// Gets information about the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterRGBDevice" />.
|
||||
/// </summary>
|
||||
public override IRGBDeviceInfo DeviceInfo { get; }
|
||||
|
||||
@ -74,11 +76,9 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
if (layout.Leds != null)
|
||||
foreach (LedLayout layoutLed in layout.Leds)
|
||||
{
|
||||
CoolerMasterLedIds ledId;
|
||||
if (Enum.TryParse(layoutLed.Id, true, out ledId))
|
||||
if (Enum.TryParse(layoutLed.Id, true, out CoolerMasterLedIds ledId))
|
||||
{
|
||||
Led led;
|
||||
if (LedMapping.TryGetValue(new CoolerMasterLedId(this, ledId), out led))
|
||||
if (LedMapping.TryGetValue(new CoolerMasterLedId(this, ledId), out Led led))
|
||||
{
|
||||
led.LedRectangle.Location.X = layoutLed.X;
|
||||
led.LedRectangle.Location.Y = layoutLed.Y;
|
||||
|
||||
@ -4,8 +4,9 @@ using RGB.NET.Devices.CoolerMaster.Helper;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a Corsair-<see cref="IRGBDevice"/>.
|
||||
/// Represents a generic information for a Corsair-<see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CoolerMasterRGBDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
|
||||
@ -4,6 +4,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a CoolerMaster keyboard.
|
||||
/// </summary>
|
||||
@ -20,8 +21,9 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CoolerMasterKeyboardRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterKeyboardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by CoolerMaster for the keyboard</param>
|
||||
internal CoolerMasterKeyboardRGBDevice(CoolerMasterKeyboardRGBDeviceInfo info)
|
||||
@ -46,7 +48,7 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
string model = KeyboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
|
||||
$@"Layouts\CoolerMaster\Keyboards\{model}\{KeyboardDeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath($@"Images\CoolerMaster\Keyboards"));
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\CoolerMaster\Keyboards"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -4,8 +4,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="CoolerMasterKeyboardRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterKeyboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CoolerMasterKeyboardRGBDeviceInfo : CoolerMasterRGBDeviceInfo
|
||||
{
|
||||
@ -25,12 +26,13 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="CoolerMasterKeyboardRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceIndex">The index of the <see cref="CoolerMasterKeyboardRGBDevice"/>.</param>
|
||||
/// <param name="physicalKeyboardLayout">The <see cref="CoolerMasterPhysicalKeyboardLayout" /> of the <see cref="CoolerMasterKeyboardRGBDevice"/>.</param>
|
||||
/// <param name="culture">The <see cref="CultureInfo"/> of the layout this keyboard is using</param>
|
||||
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterKeyboardRGBDevice" />.</param>
|
||||
/// <param name="physicalKeyboardLayout">The <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterPhysicalKeyboardLayout" /> of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterKeyboardRGBDevice" />.</param>
|
||||
/// <param name="culture">The <see cref="T:System.Globalization.CultureInfo" /> of the layout this keyboard is using</param>
|
||||
internal CoolerMasterKeyboardRGBDeviceInfo(CoolerMasterDevicesIndexes deviceIndex, CoolerMasterPhysicalKeyboardLayout physicalKeyboardLayout, CultureInfo culture)
|
||||
: base(RGBDeviceType.Keyboard, deviceIndex)
|
||||
{
|
||||
|
||||
@ -12,6 +12,7 @@ using RGB.NET.Devices.Corsair.SpecialParts;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for corsair (CUE) devices.
|
||||
/// </summary>
|
||||
@ -37,6 +38,7 @@ namespace RGB.NET.Devices.Corsair
|
||||
/// </summary>
|
||||
public static List<string> PossibleX64NativePaths { get; } = new List<string> { "x64/CUESDK.dll", "x64/CUESDK_2015.dll", "x64/CUESDK_2013.dll" };
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Indicates if the SDK is initialized and ready to use.
|
||||
/// </summary>
|
||||
@ -52,6 +54,7 @@ namespace RGB.NET.Devices.Corsair
|
||||
/// </summary>
|
||||
public CorsairProtocolDetails ProtocolDetails { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets whether the application has exclusive access to the SDK or not.
|
||||
/// </summary>
|
||||
|
||||
@ -5,6 +5,7 @@ using System;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by the CUE.
|
||||
/// </summary>
|
||||
@ -21,10 +22,11 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CUEException"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Corsair.CUEException" /> class.
|
||||
/// </summary>
|
||||
/// <param name="error">The <see cref="CorsairError" /> provided by CUE, which leads to this exception.</param>
|
||||
/// <param name="error">The <see cref="T:RGB.NET.Devices.Corsair.CorsairError" /> provided by CUE, which leads to this exception.</param>
|
||||
public CUEException(CorsairError error)
|
||||
{
|
||||
this.Error = error;
|
||||
|
||||
@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a Id of a <see cref="Led"/> on a <see cref="CorsairRGBDevice"/>.
|
||||
/// Represents a Id of a <see cref="T:RGB.NET.Core.Led" /> on a <see cref="T:RGB.NET.Devices.Corsair.CorsairRGBDevice" />.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{" + nameof(LedId) + "}")]
|
||||
public class CorsairLedId : ILedId
|
||||
|
||||
@ -9,6 +9,7 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic CUE-device. (keyboard, mouse, headset, mousepad).
|
||||
/// </summary>
|
||||
@ -16,8 +17,9 @@ namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets information about the <see cref="CorsairRGBDevice"/>.
|
||||
/// Gets information about the <see cref="T:RGB.NET.Devices.Corsair.CorsairRGBDevice" />.
|
||||
/// </summary>
|
||||
public override IRGBDeviceInfo DeviceInfo { get; }
|
||||
|
||||
@ -75,11 +77,9 @@ namespace RGB.NET.Devices.Corsair
|
||||
if (layout.Leds != null)
|
||||
foreach (LedLayout layoutLed in layout.Leds)
|
||||
{
|
||||
CorsairLedIds ledId;
|
||||
if (Enum.TryParse(layoutLed.Id, true, out ledId))
|
||||
if (Enum.TryParse(layoutLed.Id, true, out CorsairLedIds ledId))
|
||||
{
|
||||
Led led;
|
||||
if (LedMapping.TryGetValue(new CorsairLedId(this, ledId), out led))
|
||||
if (LedMapping.TryGetValue(new CorsairLedId(this, ledId), out Led led))
|
||||
{
|
||||
led.LedRectangle.Location.X = layoutLed.X;
|
||||
led.LedRectangle.Location.Y = layoutLed.Y;
|
||||
|
||||
@ -5,8 +5,9 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a Corsair-<see cref="IRGBDevice"/>.
|
||||
/// Represents a generic information for a Corsair-<see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CorsairRGBDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a corsair headset.
|
||||
/// </summary>
|
||||
@ -21,8 +22,9 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CorsairHeadsetRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Corsair.CorsairHeadsetRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by CUE for the headset</param>
|
||||
internal CorsairHeadsetRGBDevice(CorsairHeadsetRGBDeviceInfo info)
|
||||
|
||||
@ -4,18 +4,20 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="CorsairHeadsetRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Corsair.CorsairHeadsetRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CorsairHeadsetRGBDeviceInfo : CorsairRGBDeviceInfo
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="CorsairHeadsetRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Corsair.CorsairHeadsetRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceIndex">The index of the <see cref="CorsairHeadsetRGBDevice"/>.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
|
||||
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Corsair.CorsairHeadsetRGBDevice" />.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
|
||||
internal CorsairHeadsetRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
|
||||
: base(deviceIndex, RGBDeviceType.Headset, nativeInfo)
|
||||
{
|
||||
|
||||
@ -8,6 +8,7 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a corsair keyboard.
|
||||
/// </summary>
|
||||
@ -24,8 +25,9 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CorsairKeyboardRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Corsair.CorsairKeyboardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by CUE for the keyboard</param>
|
||||
internal CorsairKeyboardRGBDevice(CorsairKeyboardRGBDeviceInfo info)
|
||||
@ -59,7 +61,7 @@ namespace RGB.NET.Devices.Corsair
|
||||
string model = KeyboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
|
||||
$@"Layouts\Corsair\Keyboards\{model}\{KeyboardDeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath($@"Images\Corsair\Keyboards"));
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\Corsair\Keyboards"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -7,8 +7,9 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="CorsairKeyboardRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Corsair.CorsairKeyboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CorsairKeyboardRGBDeviceInfo : CorsairRGBDeviceInfo
|
||||
{
|
||||
@ -28,11 +29,12 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="CorsairKeyboardRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Corsair.CorsairKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceIndex">The index of the <see cref="CorsairKeyboardRGBDevice"/>.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
|
||||
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Corsair.CorsairKeyboardRGBDevice" />.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
|
||||
internal CorsairKeyboardRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
|
||||
: base(deviceIndex, RGBDeviceType.Keyboard, nativeInfo)
|
||||
{
|
||||
|
||||
@ -6,6 +6,7 @@ using RGB.NET.Core.Exceptions;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a corsair mouse.
|
||||
/// </summary>
|
||||
@ -22,8 +23,9 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CorsairMouseRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Corsair.CorsairMouseRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by CUE for the mouse</param>
|
||||
internal CorsairMouseRGBDevice(CorsairMouseRGBDeviceInfo info)
|
||||
|
||||
@ -4,8 +4,9 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="CorsairMouseRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Corsair.CorsairMouseRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CorsairMouseRGBDeviceInfo : CorsairRGBDeviceInfo
|
||||
{
|
||||
@ -20,11 +21,12 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="CorsairMouseRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Corsair.CorsairMouseRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceIndex">The index of the <see cref="CorsairMouseRGBDevice"/>.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
|
||||
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Corsair.CorsairMouseRGBDevice" />.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
|
||||
internal CorsairMouseRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
|
||||
: base(deviceIndex, RGBDeviceType.Mouse, nativeInfo)
|
||||
{
|
||||
|
||||
@ -10,6 +10,7 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a corsair mousepad.
|
||||
/// </summary>
|
||||
@ -26,8 +27,9 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CorsairMousepadRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Corsair.CorsairMousepadRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by CUE for the mousepad</param>
|
||||
internal CorsairMousepadRGBDevice(CorsairMousepadRGBDeviceInfo info)
|
||||
|
||||
@ -4,18 +4,20 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="CorsairMousepadRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Corsair.CorsairMousepadRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CorsairMousepadRGBDeviceInfo : CorsairRGBDeviceInfo
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="CorsairMousepadRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Corsair.CorsairMousepadRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceIndex">The index if the <see cref="CorsairMousepadRGBDevice"/>.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
|
||||
/// <param name="deviceIndex">The index if the <see cref="T:RGB.NET.Devices.Corsair.CorsairMousepadRGBDevice" />.</param>
|
||||
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
|
||||
internal CorsairMousepadRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
|
||||
: base(deviceIndex, RGBDeviceType.Mousepad, nativeInfo)
|
||||
{
|
||||
|
||||
@ -9,8 +9,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair.SpecialParts
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a lightbar attached to a <see cref="IRGBDevice"/>
|
||||
/// Represents a lightbar attached to a <see cref="T:RGB.NET.Core.IRGBDevice" />
|
||||
/// </summary>
|
||||
public class LightbarSpecialPart : IRGBDeviceSpecialPart
|
||||
{
|
||||
@ -59,16 +60,18 @@ namespace RGB.NET.Devices.Corsair.SpecialParts
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates over all <see cref="Led"/> of the <see cref="IRGBDeviceSpecialPart"/>.
|
||||
/// Returns an enumerator that iterates over all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDeviceSpecialPart" />.
|
||||
/// </summary>
|
||||
/// <returns>An enumerator for all <see cref="Led"/> of the <see cref="IRGBDeviceSpecialPart"/>.</returns>
|
||||
/// <returns>An enumerator for all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDeviceSpecialPart" />.</returns>
|
||||
public IEnumerator<Led> GetEnumerator() => _leds.GetEnumerator();
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Returns an enumerator that iterates over all <see cref="Led"/> of the <see cref="IRGBDeviceSpecialPart"/>.
|
||||
/// Returns an enumerator that iterates over all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDeviceSpecialPart" />.
|
||||
/// </summary>
|
||||
/// <returns>An enumerator for all <see cref="Led"/> of the <see cref="IRGBDeviceSpecialPart"/>.</returns>
|
||||
/// <returns>An enumerator for all <see cref="T:RGB.NET.Core.Led" /> of the <see cref="T:RGB.NET.Core.IRGBDeviceSpecialPart" />.</returns>
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
#endregion
|
||||
|
||||
@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a Id of a <see cref="Led"/> on a <see cref="LogitechRGBDevice"/>.
|
||||
/// Represents a Id of a <see cref="T:RGB.NET.Core.Led" /> on a <see cref="T:RGB.NET.Devices.Logitech.LogitechRGBDevice" />.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{" + nameof(LedId) + "}")]
|
||||
public class LogitechLedId : ILedId
|
||||
|
||||
@ -8,6 +8,7 @@ using RGB.NET.Devices.Logitech.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic Logitech-device. (keyboard, mouse, headset, mousepad).
|
||||
/// </summary>
|
||||
@ -15,8 +16,9 @@ namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets information about the <see cref="LogitechRGBDevice"/>.
|
||||
/// Gets information about the <see cref="T:RGB.NET.Devices.Logitech.LogitechRGBDevice" />.
|
||||
/// </summary>
|
||||
public override IRGBDeviceInfo DeviceInfo { get; }
|
||||
|
||||
@ -74,12 +76,10 @@ namespace RGB.NET.Devices.Logitech
|
||||
if (layout.Leds != null)
|
||||
foreach (LedLayout layoutLed in layout.Leds)
|
||||
{
|
||||
LogitechLedIds ledId;
|
||||
if (Enum.TryParse(layoutLed.Id, true, out ledId))
|
||||
if (Enum.TryParse(layoutLed.Id, true, out LogitechLedIds ledId))
|
||||
{
|
||||
LogitechLedId id = new LogitechLedId(this, ledId);
|
||||
Led led;
|
||||
if (!LedMapping.TryGetValue(id, out led))
|
||||
if (!LedMapping.TryGetValue(id, out Led led))
|
||||
led = InitializeLed(id, new Rectangle());
|
||||
|
||||
led.LedRectangle.Location.X = layoutLed.X;
|
||||
@ -110,8 +110,7 @@ namespace RGB.NET.Devices.Logitech
|
||||
foreach (Led led in leds)
|
||||
{
|
||||
//TODO DarthAffe 26.03.2017: This is only needed since update by name doesn't work as expected for all keys ...
|
||||
int bitmapOffset;
|
||||
if (BitmapMapping.BitmapOffset.TryGetValue(((LogitechLedId)led.Id).LedId, out bitmapOffset))
|
||||
if (BitmapMapping.BitmapOffset.TryGetValue(((LogitechLedId)led.Id).LedId, out int bitmapOffset))
|
||||
{
|
||||
if (bitmap == null)
|
||||
bitmap = BitmapMapping.CreateBitmap();
|
||||
|
||||
@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a Logitech-<see cref="IRGBDevice"/>.
|
||||
/// Represents a generic information for a Logitech-<see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class LogitechRGBDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a logitech keyboard.
|
||||
/// </summary>
|
||||
@ -21,8 +22,9 @@ namespace RGB.NET.Devices.Logitech
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LogitechKeyboardRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Logitech.LogitechKeyboardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by logitech for the keyboard</param>
|
||||
internal LogitechKeyboardRGBDevice(LogitechKeyboardRGBDeviceInfo info)
|
||||
@ -41,7 +43,7 @@ namespace RGB.NET.Devices.Logitech
|
||||
string model = KeyboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
|
||||
$@"Layouts\Logitech\Keyboards\{model}\{KeyboardDeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath($@"Images\Logitech\Keyboards"));
|
||||
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\Logitech\Keyboards"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -7,8 +7,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="LogitechKeyboardRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Logitech.LogitechKeyboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class LogitechKeyboardRGBDeviceInfo : LogitechRGBDeviceInfo
|
||||
{
|
||||
@ -28,12 +29,13 @@ namespace RGB.NET.Devices.Logitech
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="LogitechKeyboardRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Logitech.LogitechKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="model">The represented device model.</param>
|
||||
/// <param name="deviceCaps">The lighting-capabilities of the device.</param>
|
||||
/// <param name="culture">The <see cref="CultureInfo"/> of the layout this keyboard is using</param>
|
||||
/// <param name="culture">The <see cref="T:System.Globalization.CultureInfo" /> of the layout this keyboard is using</param>
|
||||
internal LogitechKeyboardRGBDeviceInfo(string model, LogitechDeviceCaps deviceCaps, CultureInfo culture)
|
||||
: base(RGBDeviceType.Keyboard, model, deviceCaps)
|
||||
{
|
||||
|
||||
@ -11,6 +11,7 @@ using RGB.NET.Devices.Logitech.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for logitech devices.
|
||||
/// </summary>
|
||||
@ -53,7 +54,7 @@ namespace RGB.NET.Devices.Logitech
|
||||
/// <summary>
|
||||
/// Gets or sets a function to get the culture for a specific device.
|
||||
/// </summary>
|
||||
public Func<CultureInfo> GetCulture { get; set; } = () => CultureHelper.GetCurrentCulture();
|
||||
public Func<CultureInfo> GetCulture { get; set; } = CultureHelper.GetCurrentCulture;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace RGB.NET.Devices.Novation.Attributes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Specifies the color-capability of a field.
|
||||
/// </summary>
|
||||
@ -19,8 +20,9 @@ namespace RGB.NET.Devices.Novation.Attributes
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ColorCapabilityAttribute"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Novation.Attributes.ColorCapabilityAttribute" /> class.
|
||||
/// </summary>
|
||||
/// <param name="capability">The capability.</param>
|
||||
public ColorCapabilityAttribute(NovationColorCapabilities capability)
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace RGB.NET.Devices.Novation.Attributes
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Specifies the device-id of a field.
|
||||
/// </summary>
|
||||
@ -19,8 +20,9 @@ namespace RGB.NET.Devices.Novation.Attributes
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DeviceIdAttribute"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Novation.Attributes.DeviceIdAttribute" /> class.
|
||||
/// </summary>
|
||||
/// <param name="id">The id.</param>
|
||||
public DeviceIdAttribute(string id)
|
||||
|
||||
@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a Id of a <see cref="Led"/> on a <see cref="NovationRGBDevice"/>.
|
||||
/// Represents a Id of a <see cref="T:RGB.NET.Core.Led" /> on a <see cref="T:RGB.NET.Devices.Novation.NovationRGBDevice" />.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{" + nameof(LedId) + "}")]
|
||||
public class NovationLedId : ILedId
|
||||
|
||||
@ -8,6 +8,7 @@ using Sanford.Multimedia.Midi;
|
||||
|
||||
namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic Novation-device. (launchpad).
|
||||
/// </summary>
|
||||
@ -18,8 +19,9 @@ namespace RGB.NET.Devices.Novation
|
||||
private readonly OutputDevice _outputDevice;
|
||||
private readonly NovationRGBDeviceInfo _deviceInfo;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets information about the <see cref="NovationRGBDevice"/>.
|
||||
/// Gets information about the <see cref="T:RGB.NET.Devices.Novation.NovationRGBDevice" />.
|
||||
/// </summary>
|
||||
public override IRGBDeviceInfo DeviceInfo => _deviceInfo;
|
||||
|
||||
@ -80,11 +82,9 @@ namespace RGB.NET.Devices.Novation
|
||||
if (layout.Leds != null)
|
||||
foreach (LedLayout layoutLed in layout.Leds)
|
||||
{
|
||||
NovationLedIds ledId;
|
||||
if (Enum.TryParse(layoutLed.Id, true, out ledId))
|
||||
if (Enum.TryParse(layoutLed.Id, true, out NovationLedIds ledId))
|
||||
{
|
||||
Led led;
|
||||
if (LedMapping.TryGetValue(new NovationLedId(this, ledId), out led))
|
||||
if (LedMapping.TryGetValue(new NovationLedId(this, ledId), out Led led))
|
||||
{
|
||||
led.LedRectangle.Location.X = layoutLed.X;
|
||||
led.LedRectangle.Location.Y = layoutLed.Y;
|
||||
|
||||
@ -3,8 +3,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a Corsair-<see cref="IRGBDevice"/>.
|
||||
/// Represents a generic information for a Corsair-<see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class NovationRGBDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
|
||||
@ -3,6 +3,7 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a Novation launchpad.
|
||||
/// </summary>
|
||||
@ -19,8 +20,9 @@ namespace RGB.NET.Devices.Novation
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NovationLaunchpadRGBDevice"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by Novation for the launchpad</param>
|
||||
internal NovationLaunchpadRGBDevice(NovationLaunchpadRGBDeviceInfo info)
|
||||
|
||||
@ -3,19 +3,21 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="NovationLaunchpadRGBDevice"/>.
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDevice" />.
|
||||
/// </summary>
|
||||
public class NovationLaunchpadRGBDeviceInfo : NovationRGBDeviceInfo
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="NovationLaunchpadRGBDeviceInfo"/>.
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="model">The represented device model.</param>
|
||||
/// <param name="deviceId"></param>
|
||||
/// <param name="colorCapabilities">The <see cref="NovationColorCapabilities"/> of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="colorCapabilities">The <see cref="T:RGB.NET.Devices.Novation.NovationColorCapabilities" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</param>
|
||||
internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities)
|
||||
: base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities)
|
||||
{
|
||||
|
||||
@ -10,6 +10,7 @@ using Sanford.Multimedia.Midi;
|
||||
|
||||
namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for Novation devices.
|
||||
/// </summary>
|
||||
@ -23,11 +24,13 @@ namespace RGB.NET.Devices.Novation
|
||||
/// </summary>
|
||||
public static NovationDeviceProvider Instance => _instance ?? new NovationDeviceProvider();
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Indicates if the SDK is initialized and ready to use.
|
||||
/// </summary>
|
||||
public bool IsInitialized { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets whether the application has exclusive access to the SDK or not.
|
||||
/// </summary>
|
||||
|
||||
@ -17,9 +17,8 @@ namespace RGB.NET.Groups
|
||||
/// <returns>The converted <see cref="ListLedGroup" />.</returns>
|
||||
public static ListLedGroup ToListLedGroup(this ILedGroup ledGroup)
|
||||
{
|
||||
ListLedGroup listLedGroup = ledGroup as ListLedGroup;
|
||||
// ReSharper disable once InvertIf
|
||||
if (listLedGroup == null)
|
||||
if (!(ledGroup is ListLedGroup listLedGroup))
|
||||
{
|
||||
bool wasAttached = ledGroup.Detach();
|
||||
listLedGroup = new ListLedGroup(wasAttached, ledGroup.GetLeds()) { Brush = ledGroup.Brush };
|
||||
|
||||
@ -6,8 +6,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Groups
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a ledgroup containing arbitrary <see cref="Led"/>.
|
||||
/// Represents a ledgroup containing arbitrary <see cref="T:RGB.NET.Core.Led" />.
|
||||
/// </summary>
|
||||
public class ListLedGroup : AbstractLedGroup
|
||||
{
|
||||
@ -22,84 +23,93 @@ namespace RGB.NET.Groups
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="ListLedGroup"/> should be automatically attached or not.</param>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="T:RGB.NET.Groups.ListLedGroup" /> should be automatically attached or not.</param>
|
||||
public ListLedGroup(bool autoAttach = true)
|
||||
: base(autoAttach)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="leds">The initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="leds">The initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(params Led[] leds)
|
||||
: this(true, leds)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="leds">The initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="leds">The initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(IEnumerable<Led> leds)
|
||||
: this(true, leds)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="ListLedGroup"/> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="T:RGB.NET.Groups.ListLedGroup" /> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(bool autoAttach, IEnumerable<Led> leds)
|
||||
: base(autoAttach)
|
||||
{
|
||||
AddLeds(leds);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="ListLedGroup"/> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="T:RGB.NET.Groups.ListLedGroup" /> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(bool autoAttach, params Led[] leds)
|
||||
: base(autoAttach)
|
||||
{
|
||||
AddLeds(leds);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="leds">The IDs of the initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="leds">The IDs of the initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(params ILedId[] leds)
|
||||
: this(true, leds)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="leds">The IDs of the initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="leds">The IDs of the initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(IEnumerable<ILedId> leds)
|
||||
: this(true, leds)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="ListLedGroup"/> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The IDs of the initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="T:RGB.NET.Groups.ListLedGroup" /> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The IDs of the initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(bool autoAttach, params ILedId[] leds)
|
||||
: base(autoAttach)
|
||||
{
|
||||
AddLeds(leds);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ListLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.ListLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="ListLedGroup"/> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The IDs of the initial <see cref="Led"/> of this <see cref="ListLedGroup"/>.</param>
|
||||
/// <param name="autoAttach">Specifies whether this <see cref="T:RGB.NET.Groups.ListLedGroup" /> should be automatically attached or not.</param>
|
||||
/// <param name="leds">The IDs of the initial <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.ListLedGroup" />.</param>
|
||||
public ListLedGroup(bool autoAttach, IEnumerable<ILedId> leds)
|
||||
: base(autoAttach)
|
||||
{
|
||||
@ -227,10 +237,11 @@ namespace RGB.NET.Groups
|
||||
GroupLeds.Add(led);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets a list containing the <see cref="Led"/> from this group.
|
||||
/// Gets a list containing the <see cref="T:RGB.NET.Core.Led" /> from this group.
|
||||
/// </summary>
|
||||
/// <returns>The list containing the <see cref="Led"/>.</returns>
|
||||
/// <returns>The list containing the <see cref="T:RGB.NET.Core.Led" />.</returns>
|
||||
public override IEnumerable<Led> GetLeds()
|
||||
{
|
||||
return GroupLeds;
|
||||
|
||||
@ -9,8 +9,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Groups
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a <see cref="RectangleLedGroup"/> containing <see cref="Led"/> which physically lay inside a <see cref="Core.Rectangle"/>.
|
||||
/// Represents a <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> containing <see cref="T:RGB.NET.Core.Led" /> which physically lay inside a <see cref="T:RGB.NET.Core.Rectangle" />.
|
||||
/// </summary>
|
||||
public class RectangleLedGroup : AbstractLedGroup
|
||||
{
|
||||
@ -59,45 +60,49 @@ namespace RGB.NET.Groups
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RectangleLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="fromLed">They ID of the first <see cref="Led"/> to calculate the <see cref="Core.Rectangle"/> of this <see cref="RectangleLedGroup"/> from.</param>
|
||||
/// <param name="toLed">They ID of the second <see cref="Led"/> to calculate the <see cref="Core.Rectangle"/> of this <see cref="RectangleLedGroup"/> from.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="Led"/> must have with the <see cref="Rectangle" /> to be taken into the <see cref="RectangleLedGroup"/>. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="RectangleLedGroup"/> should be automatically attached or not. (default: true)</param>
|
||||
/// <param name="fromLed">They ID of the first <see cref="T:RGB.NET.Core.Led" /> to calculate the <see cref="T:RGB.NET.Core.Rectangle" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> from.</param>
|
||||
/// <param name="toLed">They ID of the second <see cref="T:RGB.NET.Core.Led" /> to calculate the <see cref="T:RGB.NET.Core.Rectangle" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> from.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="T:RGB.NET.Core.Led" /> must have with the <see cref="P:RGB.NET.Groups.RectangleLedGroup.Rectangle" /> to be taken into the <see cref="T:RGB.NET.Groups.RectangleLedGroup" />. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> should be automatically attached or not. (default: true)</param>
|
||||
public RectangleLedGroup(ILedId fromLed, ILedId toLed, double minOverlayPercentage = 0.5, bool autoAttach = true)
|
||||
: this(fromLed.Device[fromLed], toLed.Device[toLed], minOverlayPercentage, autoAttach)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RectangleLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="fromLed">They first <see cref="Led"/> to calculate the <see cref="Core.Rectangle"/> of this <see cref="RectangleLedGroup"/> from.</param>
|
||||
/// <param name="toLed">They second <see cref="Led"/> to calculate the <see cref="Core.Rectangle"/> of this <see cref="RectangleLedGroup"/> from.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="Led"/> must have with the <see cref="Rectangle" /> to be taken into the <see cref="RectangleLedGroup"/>. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="RectangleLedGroup"/> should be automatically attached or not. (default: true)</param>
|
||||
/// <param name="fromLed">They first <see cref="T:RGB.NET.Core.Led" /> to calculate the <see cref="T:RGB.NET.Core.Rectangle" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> from.</param>
|
||||
/// <param name="toLed">They second <see cref="T:RGB.NET.Core.Led" /> to calculate the <see cref="T:RGB.NET.Core.Rectangle" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> from.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="T:RGB.NET.Core.Led" /> must have with the <see cref="P:RGB.NET.Groups.RectangleLedGroup.Rectangle" /> to be taken into the <see cref="T:RGB.NET.Groups.RectangleLedGroup" />. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> should be automatically attached or not. (default: true)</param>
|
||||
public RectangleLedGroup(Led fromLed, Led toLed, double minOverlayPercentage = 0.5, bool autoAttach = true)
|
||||
: this(new Rectangle(fromLed.LedRectangle, toLed.LedRectangle), minOverlayPercentage, autoAttach)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RectangleLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="fromPoint">They first point to calculate the <see cref="Core.Rectangle"/> of this <see cref="RectangleLedGroup"/> from.</param>
|
||||
/// <param name="toPoint">They second point to calculate the <see cref="Core.Rectangle"/> of this <see cref="RectangleLedGroup"/> from.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="Led"/> must have with the <see cref="Rectangle" /> to be taken into the <see cref="RectangleLedGroup"/>. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="RectangleLedGroup"/> should be automatically attached or not. (default: true)</param>
|
||||
/// <param name="fromPoint">They first point to calculate the <see cref="T:RGB.NET.Core.Rectangle" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> from.</param>
|
||||
/// <param name="toPoint">They second point to calculate the <see cref="T:RGB.NET.Core.Rectangle" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> from.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="T:RGB.NET.Core.Led" /> must have with the <see cref="P:RGB.NET.Groups.RectangleLedGroup.Rectangle" /> to be taken into the <see cref="T:RGB.NET.Groups.RectangleLedGroup" />. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> should be automatically attached or not. (default: true)</param>
|
||||
public RectangleLedGroup(Point fromPoint, Point toPoint, double minOverlayPercentage = 0.5, bool autoAttach = true)
|
||||
: this(new Rectangle(fromPoint, toPoint), minOverlayPercentage, autoAttach)
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RectangleLedGroup"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="rectangle">The <see cref="Core.Rectangle"/> of this <see cref="RectangleLedGroup"/>.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="Led"/> must have with the <see cref="Rectangle" /> to be taken into the <see cref="RectangleLedGroup"/>. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="RectangleLedGroup"/> should be automatically attached or not. (default: true)</param>
|
||||
/// <param name="rectangle">The <see cref="T:RGB.NET.Core.Rectangle" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" />.</param>
|
||||
/// <param name="minOverlayPercentage">(optional) The minimal percentage overlay a <see cref="T:RGB.NET.Core.Led" /> must have with the <see cref="P:RGB.NET.Groups.RectangleLedGroup.Rectangle" /> to be taken into the <see cref="T:RGB.NET.Groups.RectangleLedGroup" />. (default: 0.5)</param>
|
||||
/// <param name="autoAttach">(optional) Specifies whether this <see cref="T:RGB.NET.Groups.RectangleLedGroup" /> should be automatically attached or not. (default: true)</param>
|
||||
public RectangleLedGroup(Rectangle rectangle, double minOverlayPercentage = 0.5, bool autoAttach = true)
|
||||
: base(autoAttach)
|
||||
{
|
||||
@ -119,10 +124,11 @@ namespace RGB.NET.Groups
|
||||
|
||||
private void RectangleChanged(object sender, EventArgs eventArgs) => InvalidateCache();
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets a list containing all <see cref="Led"/> of this <see cref="RectangleLedGroup"/>.
|
||||
/// Gets a list containing all <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" />.
|
||||
/// </summary>
|
||||
/// <returns>The list containing all <see cref="Led"/> of this <see cref="RectangleLedGroup"/>.</returns>
|
||||
/// <returns>The list containing all <see cref="T:RGB.NET.Core.Led" /> of this <see cref="T:RGB.NET.Groups.RectangleLedGroup" />.</returns>
|
||||
public override IEnumerable<Led> GetLeds() => _ledCache ?? (_ledCache = RGBSurface.Instance.Leds.Where(x => x.LedRectangle.CalculateIntersectPercentage(Rectangle) >= MinOverlayPercentage).ToList());
|
||||
|
||||
private void InvalidateCache() => _ledCache = null;
|
||||
|
||||
@ -4,8 +4,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.WPF.Controls
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes a <see cref="Core.Led"/> in an wpf-application.
|
||||
/// Visualizes a <see cref="T:RGB.NET.Core.Led" /> in an wpf-application.
|
||||
/// </summary>
|
||||
public class LedVisualizer : Control
|
||||
{
|
||||
|
||||
@ -4,8 +4,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.WPF.Controls
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes a <see cref="IRGBDevice"/> in an wpf-application.
|
||||
/// Visualizes a <see cref="T:RGB.NET.Core.IRGBDevice" /> in an wpf-application.
|
||||
/// </summary>
|
||||
[TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))]
|
||||
public class RGBDeviceVisualizer : Control
|
||||
|
||||
@ -5,8 +5,9 @@ using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.WPF.Controls
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes the <see cref="RGBSurface"/> in an wpf-application.
|
||||
/// Visualizes the <see cref="T:RGB.NET.Core.RGBSurface" /> in an wpf-application.
|
||||
/// </summary>
|
||||
[TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))]
|
||||
public class RGBSurfaceVisualizer : Control
|
||||
@ -29,8 +30,9 @@ namespace RGB.NET.WPF.Controls
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RGBSurfaceVisualizer"/> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.WPF.Controls.RGBSurfaceVisualizer" /> class.
|
||||
/// </summary>
|
||||
public RGBSurfaceVisualizer()
|
||||
{
|
||||
|
||||
@ -5,8 +5,9 @@ using System.Windows.Media;
|
||||
|
||||
namespace RGB.NET.WPF.Converter
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Converts <see cref="Core.Color"/> into <see cref="SolidColorBrush"/>.
|
||||
/// Converts <see cref="T:RGB.NET.Core.Color" /> into <see cref="T:System.Windows.Media.SolidColorBrush" />.
|
||||
/// </summary>
|
||||
[ValueConversion(typeof(Core.Color), typeof(SolidColorBrush))]
|
||||
public class ColorToSolidColorBrushConverter : IValueConverter
|
||||
@ -23,8 +24,7 @@ namespace RGB.NET.WPF.Converter
|
||||
/// <inheritdoc />
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
SolidColorBrush brush = value as SolidColorBrush;
|
||||
return brush == null
|
||||
return !(value is SolidColorBrush brush)
|
||||
? Core.Color.Transparent
|
||||
: new Core.Color(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user