mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
Sealed a lot of classes that are not meant to be inherited
This commit is contained in:
1 parent
d9c244a044
commit
2020992249
155 files changed
+205
-344
No files matched your search
@@ -12,7 +12,7 @@ namespace RGB.NET.Presets.Decorators;
|
||||
/// <summary>
|
||||
/// Represents a decorator which allows to flash a brush by modifying his opacity.
|
||||
/// </summary>
|
||||
public class FlashDecorator : AbstractUpdateAwareDecorator, IBrushDecorator
|
||||
public sealed class FlashDecorator : AbstractUpdateAwareDecorator, IBrushDecorator
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace RGB.NET.Presets.Groups;
|
||||
/// <summary>
|
||||
/// Represents a <see cref="T:RGB.NET.Presets.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
|
||||
public sealed class RectangleLedGroup : AbstractLedGroup
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace RGB.NET.Presets.Textures.Gradients;
|
||||
/// <summary>
|
||||
/// Represents a stop on a gradient.
|
||||
/// </summary>
|
||||
public class GradientStop : AbstractBindable
|
||||
public sealed class GradientStop : AbstractBindable
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace RGB.NET.Presets.Textures.Gradients;
|
||||
/// <summary>
|
||||
/// Represents a linear interpolated gradient with n stops.
|
||||
/// </summary>
|
||||
public class LinearGradient : AbstractGradient
|
||||
public sealed class LinearGradient : AbstractGradient
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private bool _isOrderedGradientListDirty = true;
|
||||
private LinkedList<GradientStop> _orderedGradientStops = new();
|
||||
private readonly List<GradientStop> _orderedGradientStops = new();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -89,7 +89,10 @@ public class LinearGradient : AbstractGradient
|
||||
if (GradientStops.Count == 1) return GradientStops[0].Color;
|
||||
|
||||
if (_isOrderedGradientListDirty)
|
||||
_orderedGradientStops = new LinkedList<GradientStop>(GradientStops.OrderBy(x => x.Offset));
|
||||
{
|
||||
_orderedGradientStops.Clear();
|
||||
_orderedGradientStops.AddRange(GradientStops.OrderBy(x => x.Offset));
|
||||
}
|
||||
|
||||
(GradientStop gsBefore, GradientStop gsAfter) = GetEnclosingGradientStops(offset, _orderedGradientStops, WrapGradient);
|
||||
|
||||
@@ -112,7 +115,7 @@ public class LinearGradient : AbstractGradient
|
||||
/// <param name="orderedStops">The ordered list of <see cref="GradientStop"/> to choose from.</param>
|
||||
/// <param name="wrap">Bool indicating if the gradient should be wrapped or not.</param>
|
||||
/// <returns>The two <see cref="GradientStop"/>s encapsulating the specified offset.</returns>
|
||||
protected virtual (GradientStop gsBefore, GradientStop gsAfter) GetEnclosingGradientStops(float offset, LinkedList<GradientStop> orderedStops, bool wrap)
|
||||
private (GradientStop gsBefore, GradientStop gsAfter) GetEnclosingGradientStops(float offset, IEnumerable<GradientStop> orderedStops, bool wrap)
|
||||
{
|
||||
LinkedList<GradientStop> gradientStops = new(orderedStops);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace RGB.NET.Presets.Textures.Gradients;
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public class RainbowGradient : AbstractDecoratable<IGradientDecorator>, IGradient
|
||||
public sealed class RainbowGradient : AbstractDecoratable<IGradientDecorator>, IGradient
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
@@ -102,7 +102,7 @@ public class RainbowGradient : AbstractDecoratable<IGradientDecorator>, IGradien
|
||||
/// <summary>
|
||||
/// Should be called to indicate that the gradient was changed.
|
||||
/// </summary>
|
||||
protected void OnGradientChanged() => GradientChanged?.Invoke(this, EventArgs.Empty);
|
||||
private void OnGradientChanged() => GradientChanged?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace RGB.NET.Presets.Textures.Sampler;
|
||||
/// <summary>
|
||||
/// Represents a sampled that averages multiple byte-data entries.
|
||||
/// </summary>
|
||||
public class AverageByteSampler : ISampler<byte>
|
||||
public sealed class AverageByteSampler : ISampler<byte>
|
||||
{
|
||||
#region Constants
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace RGB.NET.Presets.Textures.Sampler;
|
||||
/// <summary>
|
||||
/// Represents a sampled that averages multiple float-data entries.
|
||||
/// </summary>
|
||||
public class AverageFloatSampler : ISampler<float>
|
||||
public sealed class AverageFloatSampler : ISampler<float>
|
||||
{
|
||||
#region Methods
|
||||
|
||||
|
||||
Reference in new issue
Block a user