mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Project cleanup
This commit is contained in:
1 parent
9ad3e04a69
commit
adac6f4f8c
30 files changed
+254
-268
No files matched your search
@@ -11,6 +11,16 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
/// </summary>
|
||||
public class LedVisualizer : Control
|
||||
{
|
||||
public void Select()
|
||||
{
|
||||
BorderBrush = new SolidColorBrush(Colors.RoyalBlue);
|
||||
}
|
||||
|
||||
public void Deselect()
|
||||
{
|
||||
BorderBrush = new SolidColorBrush(Colors.Black);
|
||||
}
|
||||
|
||||
#region DependencyProperties
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
@@ -33,15 +43,5 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
// ReSharper restore InconsistentNaming
|
||||
|
||||
#endregion
|
||||
|
||||
public void Select()
|
||||
{
|
||||
BorderBrush = new SolidColorBrush(Colors.RoyalBlue);
|
||||
}
|
||||
|
||||
public void Deselect()
|
||||
{
|
||||
BorderBrush = new SolidColorBrush(Colors.Black);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes a <see cref="T:RGB.NET.Core.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
|
||||
@@ -18,7 +18,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
#endregion
|
||||
|
||||
#region Properties & Fields
|
||||
|
||||
|
||||
public Canvas Canvas { get; private set; }
|
||||
|
||||
#endregion
|
||||
@@ -28,13 +28,13 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
/// <summary>
|
||||
/// Backing-property for the <see cref="Device"/>-property.
|
||||
/// Backing-property for the <see cref="Device" />-property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty DeviceProperty = DependencyProperty.Register(
|
||||
"Device", typeof(IRGBDevice), typeof(RGBDeviceVisualizer), new PropertyMetadata(default(IRGBDevice), DeviceChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="IRGBDevice"/> to visualize.
|
||||
/// Gets or sets the <see cref="IRGBDevice" /> to visualize.
|
||||
/// </summary>
|
||||
public IRGBDevice Device
|
||||
{
|
||||
@@ -69,7 +69,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
|
||||
if (Device == null) return;
|
||||
|
||||
foreach (Led led in Device)
|
||||
foreach (var led in Device)
|
||||
Canvas.Children.Add(new LedVisualizer {Led = led});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Visualizes the <see cref="T:RGB.NET.Core.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
|
||||
@@ -41,12 +41,12 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.WPF.Controls.RGBSurfaceVisualizer" /> class.
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.WPF.Controls.RGBSurfaceVisualizer" /> class.
|
||||
/// </summary>
|
||||
public RGBSurfaceVisualizer()
|
||||
{
|
||||
this.Loaded += OnLoaded;
|
||||
this.Unloaded += OnUnloaded;
|
||||
Loaded += OnLoaded;
|
||||
Unloaded += OnUnloaded;
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
|
||||
@@ -54,7 +54,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
_surface = RGBSurface.Instance;
|
||||
|
||||
_surface.SurfaceLayoutChanged += RGBSurfaceOnSurfaceLayoutChanged;
|
||||
foreach (IRGBDevice device in _surface.Devices)
|
||||
foreach (var device in _surface.Devices)
|
||||
_newDevices.Add(device);
|
||||
|
||||
UpdateSurface();
|
||||
@@ -70,7 +70,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
private void RGBSurfaceOnSurfaceLayoutChanged(SurfaceLayoutChangedEventArgs args)
|
||||
{
|
||||
if (args.DeviceAdded)
|
||||
foreach (IRGBDevice device in args.Devices)
|
||||
foreach (var device in args.Devices)
|
||||
_newDevices.Add(device);
|
||||
|
||||
UpdateSurface();
|
||||
@@ -89,6 +89,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
_canvas.MouseLeftButtonDown -= ScrollViewerOnMouseLeftButtonDown;
|
||||
_canvas.MouseLeftButtonUp -= ScrollViewerOnMouseLeftButtonUp;
|
||||
}
|
||||
|
||||
_canvas?.Children.Clear();
|
||||
_canvas = (Canvas) GetTemplateChild(PART_CANVAS);
|
||||
|
||||
@@ -151,11 +152,11 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
|
||||
private void UpdateSurface()
|
||||
{
|
||||
if ((_canvas == null) || (_surface == null)) return;
|
||||
if (_canvas == null || _surface == null) return;
|
||||
|
||||
if (_newDevices.Count > 0)
|
||||
{
|
||||
foreach (IRGBDevice device in _newDevices)
|
||||
foreach (var device in _newDevices)
|
||||
_canvas.Children.Add(new RGBDeviceVisualizer {Device = device});
|
||||
_newDevices.Clear();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user