mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-13 09:08:34 +00:00
Refactored auto-update to be SDK-wide
This commit is contained in:
parent
16c297611e
commit
8b87270b69
@ -48,6 +48,7 @@
|
|||||||
<Compile Include="Brushes\ImageBrush.cs" />
|
<Compile Include="Brushes\ImageBrush.cs" />
|
||||||
<Compile Include="Brushes\ProfileBrush.cs" />
|
<Compile Include="Brushes\ProfileBrush.cs" />
|
||||||
<Compile Include="Brushes\BrushRenderTarget.cs" />
|
<Compile Include="Brushes\BrushRenderTarget.cs" />
|
||||||
|
<Compile Include="CueSDKAutoUpdate.cs" />
|
||||||
<Compile Include="Devices\Generic\Enums\CorsairAccessMode.cs" />
|
<Compile Include="Devices\Generic\Enums\CorsairAccessMode.cs" />
|
||||||
<Compile Include="Devices\Generic\Enums\CorsairDeviceCaps.cs" />
|
<Compile Include="Devices\Generic\Enums\CorsairDeviceCaps.cs" />
|
||||||
<Compile Include="Devices\Generic\Enums\CorsairDeviceType.cs" />
|
<Compile Include="Devices\Generic\Enums\CorsairDeviceType.cs" />
|
||||||
|
|||||||
20
CueSDK.cs
20
CueSDK.cs
@ -2,7 +2,9 @@
|
|||||||
// ReSharper disable UnusedMember.Global
|
// ReSharper disable UnusedMember.Global
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using CUE.NET.Devices;
|
||||||
using CUE.NET.Devices.Generic;
|
using CUE.NET.Devices.Generic;
|
||||||
using CUE.NET.Devices.Generic.Enums;
|
using CUE.NET.Devices.Generic.Enums;
|
||||||
using CUE.NET.Devices.Headset;
|
using CUE.NET.Devices.Headset;
|
||||||
@ -14,7 +16,7 @@ using CUE.NET.Native;
|
|||||||
|
|
||||||
namespace CUE.NET
|
namespace CUE.NET
|
||||||
{
|
{
|
||||||
public static class CueSDK
|
public static partial class CueSDK
|
||||||
{
|
{
|
||||||
#region Properties & Fields
|
#region Properties & Fields
|
||||||
|
|
||||||
@ -45,6 +47,11 @@ namespace CUE.NET
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static CorsairError LastError => _CUESDK.CorsairGetLastError();
|
public static CorsairError LastError => _CUESDK.CorsairGetLastError();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets all initialized devices managed by the CUE-SDK.
|
||||||
|
/// </summary>
|
||||||
|
public static IEnumerable<ICueDevice> InitializedDevices { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the managed representation of a keyboard managed by the CUE-SDK.
|
/// Gets the managed representation of a keyboard managed by the CUE-SDK.
|
||||||
/// Note that currently only one connected keyboard is supported.
|
/// Note that currently only one connected keyboard is supported.
|
||||||
@ -155,6 +162,7 @@ namespace CUE.NET
|
|||||||
HasExclusiveAccess = true;
|
HasExclusiveAccess = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IList<ICueDevice> devices = new List<ICueDevice>();
|
||||||
int deviceCount = _CUESDK.CorsairGetDeviceCount();
|
int deviceCount = _CUESDK.CorsairGetDeviceCount();
|
||||||
for (int i = 0; i < deviceCount; i++)
|
for (int i = 0; i < deviceCount; i++)
|
||||||
{
|
{
|
||||||
@ -166,16 +174,16 @@ namespace CUE.NET
|
|||||||
switch (info.Type)
|
switch (info.Type)
|
||||||
{
|
{
|
||||||
case CorsairDeviceType.Keyboard:
|
case CorsairDeviceType.Keyboard:
|
||||||
KeyboardSDK = new CorsairKeyboard(new CorsairKeyboardDeviceInfo(nativeDeviceInfo));
|
devices.Add(KeyboardSDK = new CorsairKeyboard(new CorsairKeyboardDeviceInfo(nativeDeviceInfo)));
|
||||||
break;
|
break;
|
||||||
case CorsairDeviceType.Mouse:
|
case CorsairDeviceType.Mouse:
|
||||||
MouseSDK = new CorsairMouse(new CorsairMouseDeviceInfo(nativeDeviceInfo));
|
devices.Add(MouseSDK = new CorsairMouse(new CorsairMouseDeviceInfo(nativeDeviceInfo)));
|
||||||
break;
|
break;
|
||||||
case CorsairDeviceType.Headset:
|
case CorsairDeviceType.Headset:
|
||||||
HeadsetSDK = new CorsairHeadset(new CorsairHeadsetDeviceInfo(nativeDeviceInfo));
|
devices.Add(HeadsetSDK = new CorsairHeadset(new CorsairHeadsetDeviceInfo(nativeDeviceInfo)));
|
||||||
break;
|
break;
|
||||||
case CorsairDeviceType.Mousemat:
|
case CorsairDeviceType.Mousemat:
|
||||||
MousematSDK = new CorsairMousemat(new CorsairMousematDeviceInfo(nativeDeviceInfo));
|
devices.Add(MousematSDK = new CorsairMousemat(new CorsairMousematDeviceInfo(nativeDeviceInfo)));
|
||||||
break;
|
break;
|
||||||
// ReSharper disable once RedundantCaseLabel
|
// ReSharper disable once RedundantCaseLabel
|
||||||
case CorsairDeviceType.Unknown:
|
case CorsairDeviceType.Unknown:
|
||||||
@ -188,6 +196,8 @@ namespace CUE.NET
|
|||||||
Throw(error);
|
Throw(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InitializedDevices = new ReadOnlyCollection<ICueDevice>(devices);
|
||||||
|
|
||||||
IsInitialized = true;
|
IsInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
91
CueSDKAutoUpdate.cs
Normal file
91
CueSDKAutoUpdate.cs
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using CUE.NET.Devices;
|
||||||
|
using CUE.NET.Devices.Generic.Enums;
|
||||||
|
|
||||||
|
namespace CUE.NET
|
||||||
|
{
|
||||||
|
public static partial class CueSDK
|
||||||
|
{
|
||||||
|
#region Properties & Fields
|
||||||
|
|
||||||
|
private static CancellationTokenSource _updateTokenSource;
|
||||||
|
private static CancellationToken _updateToken;
|
||||||
|
private static Task _updateTask;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the update-frequency in seconds. (Calculate by using '1f / updates per second')
|
||||||
|
/// </summary>
|
||||||
|
public static float UpdateFrequency { get; set; } = 1f / 30f;
|
||||||
|
|
||||||
|
private static UpdateMode _updateMode = UpdateMode.Manual;
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the update-mode for the device.
|
||||||
|
/// </summary>
|
||||||
|
public static UpdateMode UpdateMode
|
||||||
|
{
|
||||||
|
get { return _updateMode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_updateMode = value;
|
||||||
|
CheckUpdateLoop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if automatic updates should occur and starts/stops the update-loop if needed.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException">Thrown if the requested update-mode is not available.</exception>
|
||||||
|
private static async void CheckUpdateLoop()
|
||||||
|
{
|
||||||
|
bool shouldRun;
|
||||||
|
switch (UpdateMode)
|
||||||
|
{
|
||||||
|
case UpdateMode.Manual:
|
||||||
|
shouldRun = false;
|
||||||
|
break;
|
||||||
|
case UpdateMode.Continuous:
|
||||||
|
shouldRun = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldRun && _updateTask == null) // Start task
|
||||||
|
{
|
||||||
|
_updateTokenSource?.Dispose();
|
||||||
|
_updateTokenSource = new CancellationTokenSource();
|
||||||
|
_updateTask = Task.Factory.StartNew(UpdateLoop, (_updateToken = _updateTokenSource.Token));
|
||||||
|
}
|
||||||
|
else if (!shouldRun && _updateTask != null) // Stop task
|
||||||
|
{
|
||||||
|
_updateTokenSource.Cancel();
|
||||||
|
await _updateTask;
|
||||||
|
_updateTask.Dispose();
|
||||||
|
_updateTask = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void UpdateLoop()
|
||||||
|
{
|
||||||
|
while (!_updateToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
long preUpdateTicks = DateTime.Now.Ticks;
|
||||||
|
|
||||||
|
foreach (ICueDevice device in InitializedDevices)
|
||||||
|
device.Update();
|
||||||
|
|
||||||
|
int sleep = (int)((UpdateFrequency * 1000f) - ((DateTime.Now.Ticks - preUpdateTicks) / 10000f));
|
||||||
|
if (sleep > 0)
|
||||||
|
Thread.Sleep(sleep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -29,35 +29,13 @@ namespace CUE.NET.Devices.Generic
|
|||||||
{
|
{
|
||||||
#region Properties & Fields
|
#region Properties & Fields
|
||||||
|
|
||||||
private CancellationTokenSource _updateTokenSource;
|
private static DateTime _lastUpdate = DateTime.Now;
|
||||||
private CancellationToken _updateToken;
|
|
||||||
private Task _updateTask;
|
|
||||||
private DateTime _lastUpdate = DateTime.Now;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets generic information provided by CUE for the device.
|
/// Gets generic information provided by CUE for the device.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IDeviceInfo DeviceInfo { get; }
|
public IDeviceInfo DeviceInfo { get; }
|
||||||
|
|
||||||
private UpdateMode _updateMode = UpdateMode.Manual;
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the update-mode for the device.
|
|
||||||
/// </summary>
|
|
||||||
public UpdateMode UpdateMode
|
|
||||||
{
|
|
||||||
get { return _updateMode; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_updateMode = value;
|
|
||||||
CheckUpdateLoop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the update-frequency in seconds. (Calculate by using '1f / updates per second')
|
|
||||||
/// </summary>
|
|
||||||
public float UpdateFrequency { get; set; } = 1f / 30f;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the rectangle containing all LEDs of the device.
|
/// Gets the rectangle containing all LEDs of the device.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -166,9 +144,7 @@ namespace CUE.NET.Devices.Generic
|
|||||||
|
|
||||||
// ReSharper disable once VirtualMemberCallInConstructor - I know, but I need this ...
|
// ReSharper disable once VirtualMemberCallInConstructor - I know, but I need this ...
|
||||||
InitializeLeds();
|
InitializeLeds();
|
||||||
DeviceRectangle = RectangleHelper.CreateRectangleFromRectangles(((IEnumerable<CorsairLed>)this).Select(x => x.LedRectangle));
|
DeviceRectangle = RectangleHelper.CreateRectangleFromRectangles((this).Select(x => x.LedRectangle));
|
||||||
|
|
||||||
CheckUpdateLoop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -208,56 +184,6 @@ namespace CUE.NET.Devices.Generic
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Update-Loop
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Checks if automatic updates should occur and starts/stops the update-loop if needed.
|
|
||||||
/// </summary>
|
|
||||||
/// <exception cref="ArgumentOutOfRangeException">Thrown if the requested update-mode is not available.</exception>
|
|
||||||
protected async void CheckUpdateLoop()
|
|
||||||
{
|
|
||||||
bool shouldRun;
|
|
||||||
switch (UpdateMode)
|
|
||||||
{
|
|
||||||
case UpdateMode.Manual:
|
|
||||||
shouldRun = false;
|
|
||||||
break;
|
|
||||||
case UpdateMode.Continuous:
|
|
||||||
shouldRun = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new ArgumentOutOfRangeException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldRun && _updateTask == null) // Start task
|
|
||||||
{
|
|
||||||
_updateTokenSource?.Dispose();
|
|
||||||
_updateTokenSource = new CancellationTokenSource();
|
|
||||||
_updateTask = Task.Factory.StartNew(UpdateLoop, (_updateToken = _updateTokenSource.Token));
|
|
||||||
}
|
|
||||||
else if (!shouldRun && _updateTask != null) // Stop task
|
|
||||||
{
|
|
||||||
_updateTokenSource.Cancel();
|
|
||||||
await _updateTask;
|
|
||||||
_updateTask.Dispose();
|
|
||||||
_updateTask = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateLoop()
|
|
||||||
{
|
|
||||||
while (!_updateToken.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
long preUpdateTicks = DateTime.Now.Ticks;
|
|
||||||
Update();
|
|
||||||
int sleep = (int)((UpdateFrequency * 1000f) - ((DateTime.Now.Ticks - preUpdateTicks) / 10000f));
|
|
||||||
if (sleep > 0)
|
|
||||||
Thread.Sleep(sleep);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Update
|
#region Update
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -10,6 +10,8 @@ using CUE.NET.Groups;
|
|||||||
|
|
||||||
namespace CUE.NET.Devices
|
namespace CUE.NET.Devices
|
||||||
{
|
{
|
||||||
|
#region EventHandler
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the event-handler of the Exception-event.
|
/// Represents the event-handler of the Exception-event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -45,26 +47,20 @@ namespace CUE.NET.Devices
|
|||||||
/// <param name="args">The arguments provided by the event.</param>
|
/// <param name="args">The arguments provided by the event.</param>
|
||||||
public delegate void LedsUpdatedEventHandler(object sender, LedsUpdatedEventArgs args);
|
public delegate void LedsUpdatedEventHandler(object sender, LedsUpdatedEventArgs args);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a generic cue device.
|
/// Represents a generic cue device.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ICueDevice : ILedGroup, IEnumerable<CorsairLed>
|
public interface ICueDevice : ILedGroup, IEnumerable<CorsairLed>
|
||||||
{
|
{
|
||||||
|
#region Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets generic information provided by CUE for the device.
|
/// Gets generic information provided by CUE for the device.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IDeviceInfo DeviceInfo { get; }
|
IDeviceInfo DeviceInfo { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the update-mode for the device.
|
|
||||||
/// </summary>
|
|
||||||
UpdateMode UpdateMode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the update-frequency in seconds. (Calculate by using '1f / updates per second')
|
|
||||||
/// </summary>
|
|
||||||
float UpdateFrequency { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the rectangle containing all LEDs of the device.
|
/// Gets the rectangle containing all LEDs of the device.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -75,6 +71,10 @@ namespace CUE.NET.Devices
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
IEnumerable<CorsairLed> Leds { get; }
|
IEnumerable<CorsairLed> Leds { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Indexer
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="CorsairLed" /> with the specified ID.
|
/// Gets the <see cref="CorsairLed" /> with the specified ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -97,6 +97,10 @@ namespace CUE.NET.Devices
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerable<CorsairLed> this[RectangleF referenceRect, float minOverlayPercentage = 0.5f] { get; }
|
IEnumerable<CorsairLed> this[RectangleF referenceRect, float minOverlayPercentage = 0.5f] { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Events
|
||||||
|
|
||||||
// ReSharper disable EventNeverSubscribedTo.Global
|
// ReSharper disable EventNeverSubscribedTo.Global
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -126,12 +130,21 @@ namespace CUE.NET.Devices
|
|||||||
|
|
||||||
// ReSharper restore EventNeverSubscribedTo.Global
|
// ReSharper restore EventNeverSubscribedTo.Global
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Perform an update for all dirty keys, or all keys if flushLeds is set to true.
|
/// Perform an update for all dirty keys, or all keys if flushLeds is set to true.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="flushLeds">Specifies whether all keys (including clean ones) should be updated.</param>
|
/// <param name="flushLeds">Specifies whether all keys (including clean ones) should be updated.</param>
|
||||||
void Update(bool flushLeds = false);
|
void Update(bool flushLeds = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attaches the given ledgroup.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ledGroup">The ledgroup to attach.</param>
|
||||||
|
/// <returns><c>true</c> if the ledgroup could be attached; otherwise, <c>false</c>.</returns>
|
||||||
bool AttachLedGroup(ILedGroup ledGroup);
|
bool AttachLedGroup(ILedGroup ledGroup);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -140,5 +153,7 @@ namespace CUE.NET.Devices
|
|||||||
/// <param name="ledGroup">The ledgroup to detached.</param>
|
/// <param name="ledGroup">The ledgroup to detached.</param>
|
||||||
/// <returns><c>true</c> if the ledgroup could be detached; otherwise, <c>false</c>.</returns>
|
/// <returns><c>true</c> if the ledgroup could be detached; otherwise, <c>false</c>.</returns>
|
||||||
bool DetachLedGroup(ILedGroup ledGroup);
|
bool DetachLedGroup(ILedGroup ledGroup);
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ namespace Example_AudioAnalyzer_full
|
|||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
_keyboard.UpdateMode = UpdateMode.Continuous;
|
CueSDK.UpdateMode = UpdateMode.Continuous;
|
||||||
// Add a black background. We want this to be semi-transparent to add some sort of fade-effect - this will smooth everything out a bit
|
// Add a black background. We want this to be semi-transparent to add some sort of fade-effect - this will smooth everything out a bit
|
||||||
// Note that this isn't a 'real effect' since it's update-rate dependent. A real effect would do always the same thing not mather how fast the keyboard updates.
|
// Note that this isn't a 'real effect' since it's update-rate dependent. A real effect would do always the same thing not mather how fast the keyboard updates.
|
||||||
_keyboard.Brush = new SolidColorBrush(Color.FromArgb(96, 0, 0, 0));
|
_keyboard.Brush = new SolidColorBrush(Color.FromArgb(96, 0, 0, 0));
|
||||||
|
|||||||
@ -36,9 +36,13 @@ namespace SimpleDevTest
|
|||||||
CueSDK.Initialize();
|
CueSDK.Initialize();
|
||||||
Console.WriteLine("Initialized with " + CueSDK.LoadedArchitecture + "-SDK");
|
Console.WriteLine("Initialized with " + CueSDK.LoadedArchitecture + "-SDK");
|
||||||
|
|
||||||
|
CueSDK.UpdateMode = UpdateMode.Continuous;
|
||||||
|
|
||||||
IBrush rainbowBrush = new LinearGradientBrush(new RainbowGradient());
|
IBrush rainbowBrush = new LinearGradientBrush(new RainbowGradient());
|
||||||
rainbowBrush.AddEffect(new FlashEffect());
|
rainbowBrush.AddEffect(new FlashEffect());
|
||||||
|
|
||||||
|
AddTestBrush(CueSDK.KeyboardSDK, rainbowBrush);
|
||||||
|
AddTestBrush(CueSDK.KeyboardSDK, rainbowBrush);
|
||||||
AddTestBrush(CueSDK.KeyboardSDK, rainbowBrush);
|
AddTestBrush(CueSDK.KeyboardSDK, rainbowBrush);
|
||||||
AddTestBrush(CueSDK.MouseSDK, rainbowBrush);
|
AddTestBrush(CueSDK.MouseSDK, rainbowBrush);
|
||||||
AddTestBrush(CueSDK.HeadsetSDK, rainbowBrush);
|
AddTestBrush(CueSDK.HeadsetSDK, rainbowBrush);
|
||||||
@ -378,7 +382,6 @@ namespace SimpleDevTest
|
|||||||
{
|
{
|
||||||
if (device == null) return;
|
if (device == null) return;
|
||||||
|
|
||||||
device.UpdateMode = UpdateMode.Continuous;
|
|
||||||
device.Brush = (SolidColorBrush)Color.Black;
|
device.Brush = (SolidColorBrush)Color.Black;
|
||||||
ILedGroup leds = new ListLedGroup(device, device);
|
ILedGroup leds = new ListLedGroup(device, device);
|
||||||
leds.Brush = brush;
|
leds.Brush = brush;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user