1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Added IsEnabled to Brushes and Effects

This commit is contained in:
Darth Affe 2017-01-28 10:44:00 +01:00
parent 2a5b8d0435
commit 6edef71875
7 changed files with 23 additions and 0 deletions

View File

@ -14,6 +14,9 @@ namespace RGB.NET.Core
{
#region Properties & Fields
/// <inheritdoc />
public bool IsEnabled { get; set; } = true;
/// <inheritdoc />
public BrushCalculationMode BrushCalculationMode { get; set; } = BrushCalculationMode.Relative;

View File

@ -11,6 +11,11 @@ namespace RGB.NET.Core
/// </summary>
public interface IBrush : IEffectTarget<IBrush>
{
/// <summary>
/// Gets or sets if the <see cref="IBrush"/> is enabled and will be drawn on an update.
/// </summary>
bool IsEnabled { get; set; }
/// <summary>
/// Gets or sets the calculation mode used for the rectangle/points used for color-selection in brushes.
/// </summary>

View File

@ -10,6 +10,9 @@ namespace RGB.NET.Core
{
#region Properties & Fields
/// <inheritdoc />
public bool IsEnabled { get; set; } = true;
/// <inheritdoc />
public bool IsDone { get; protected set; }

View File

@ -45,6 +45,8 @@ namespace RGB.NET.Core
for (int i = EffectTimes.Count - 1; i >= 0; i--)
{
EffectTimeContainer effectTime = EffectTimes[i];
if (!effectTime.Effect.IsEnabled) continue;
long currentTicks = DateTime.Now.Ticks;
double deltaTime;

View File

@ -12,6 +12,9 @@ namespace RGB.NET.Core
{
#region Properties & Fields
/// <inheritdoc />
public bool IsEnabled { get; set; } = true;
/// <inheritdoc />
public bool IsDone { get; protected set; }

View File

@ -11,6 +11,11 @@ namespace RGB.NET.Core
{
#region Properties & Fields
/// <summary>
/// Gets or sets if the <see cref="IEffect"/> is enabled and will be updated.
/// </summary>
bool IsEnabled { get; set; }
/// <summary>
/// Gets if this <see cref="IEffect"/> has finished all of his work.
/// </summary>

View File

@ -93,6 +93,8 @@ namespace RGB.NET.Core
IList<Led> leds = ledGroup.GetLeds().ToList();
IBrush brush = ledGroup.Brush;
if (!brush.IsEnabled) return;
try
{
switch (brush.BrushCalculationMode)