mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Finalized client-side storage
This commit is contained in:
1 parent
6eefa733b4
commit
7773d377a2
29 files changed
+961
-434
No files matched your search
@@ -0,0 +1,44 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Artemis.UI.Adorners
|
||||
{
|
||||
public class BoundingBoxAdorner : Adorner
|
||||
{
|
||||
private Color _boundingBoxColor;
|
||||
private Rect _boundingBoxRect;
|
||||
|
||||
public BoundingBoxAdorner(UIElement adornedElement, Color boundingBoxColor) : base(adornedElement)
|
||||
{
|
||||
_boundingBoxRect = new Rect(new Size(0, 0));
|
||||
BoundingBoxColor = boundingBoxColor;
|
||||
|
||||
IsHitTestVisible = false;
|
||||
}
|
||||
|
||||
public Color BoundingBoxColor
|
||||
{
|
||||
get => _boundingBoxColor;
|
||||
set
|
||||
{
|
||||
_boundingBoxColor = value;
|
||||
InvalidateVisual();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnRender(DrawingContext drawingContext)
|
||||
{
|
||||
var renderBrush = new SolidColorBrush(BoundingBoxColor) {Opacity = 0.2};
|
||||
var renderPen = new Pen(new SolidColorBrush(BoundingBoxColor), 1.5);
|
||||
|
||||
drawingContext.DrawRectangle(renderBrush, renderPen, _boundingBoxRect);
|
||||
}
|
||||
|
||||
public void Update(Point startingPoint, Point currentPoint)
|
||||
{
|
||||
_boundingBoxRect = new Rect(startingPoint, currentPoint);
|
||||
InvalidateVisual();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,9 @@
|
||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="HidSharp, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\HidSharp.1.5\lib\net35\HidSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -63,6 +66,42 @@
|
||||
<Reference Include="PropertyChanged, Version=2.2.4.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\PropertyChanged.Fody.2.2.4.0\lib\net452\PropertyChanged.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Brushes, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Brushes.0.0.1.26\lib\net45\RGB.NET.Brushes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Core, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.0.1.26\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Decorators, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Decorators.0.0.1.26\lib\net45\RGB.NET.Decorators.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Asus, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Asus.0.0.1.26\lib\net45\RGB.NET.Devices.Asus.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.CoolerMaster, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.26\lib\net45\RGB.NET.Devices.CoolerMaster.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Corsair, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.0.1.26\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Logitech, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Logitech.0.0.1.26\lib\net45\RGB.NET.Devices.Logitech.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Msi, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Msi.0.0.1.26\lib\net45\RGB.NET.Devices.Msi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Novation, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Novation.0.0.1.26\lib\net45\RGB.NET.Devices.Novation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Razer, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Razer.0.0.1.26\lib\net45\RGB.NET.Devices.Razer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Groups, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Groups.0.0.1.26\lib\net45\RGB.NET.Groups.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sanford.Multimedia.Midi, Version=6.4.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Sanford.Multimedia.Midi.6.4.1\lib\net20\Sanford.Multimedia.Midi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Stylet, Version=1.1.21.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stylet.1.1.21\lib\net45\Stylet.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -70,6 +109,9 @@
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -91,6 +133,7 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Adorners\BoundingBoxAdorner.cs" />
|
||||
<Compile Include="Bootstrapper.cs" />
|
||||
<Compile Include="Controls\Visualizers\LedVisualizer.cs" />
|
||||
<Compile Include="Controls\Visualizers\RGBDeviceVisualizer.cs" />
|
||||
@@ -165,58 +208,6 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Brushes\RGB.NET.Brushes.csproj">
|
||||
<Project>{347c5f0f-f490-4dec-9c1c-6e84750d838d}</Project>
|
||||
<Name>RGB.NET.Brushes</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Core\RGB.NET.Core.csproj">
|
||||
<Project>{5a4f9a75-75fe-47cd-90e5-914d5b20d232}</Project>
|
||||
<Name>RGB.NET.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Decorators\RGB.NET.Decorators.csproj">
|
||||
<Project>{7012c431-244a-453f-b7fd-59e030cdbc44}</Project>
|
||||
<Name>RGB.NET.Decorators</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj">
|
||||
<Project>{4f2f3fbd-a1e4-4968-a2ad-0514959e5e59}</Project>
|
||||
<Name>RGB.NET.Devices.Asus</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj">
|
||||
<Project>{85609427-d433-44e2-a249-ce890b66d845}</Project>
|
||||
<Name>RGB.NET.Devices.CoolerMaster</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Corsair\RGB.NET.Devices.Corsair.csproj">
|
||||
<Project>{dda8c4c2-8abf-4fa0-9af9-c47ad0bfe47d}</Project>
|
||||
<Name>RGB.NET.Devices.Corsair</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Logitech\RGB.NET.Devices.Logitech.csproj">
|
||||
<Project>{e7b2f174-fcc6-4fc7-9970-3138b5f4c921}</Project>
|
||||
<Name>RGB.NET.Devices.Logitech</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Msi\RGB.NET.Devices.Msi.csproj">
|
||||
<Project>{4efd77c7-fdb4-4c6b-970c-0ef66d24be09}</Project>
|
||||
<Name>RGB.NET.Devices.Msi</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Novation\RGB.NET.Devices.Novation.csproj">
|
||||
<Project>{db2911f6-404c-4bc8-b35f-232a7450755f}</Project>
|
||||
<Name>RGB.NET.Devices.Novation</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Razer\RGB.NET.Devices.Razer.csproj">
|
||||
<Project>{24ff4acb-d679-4b2d-86d4-50ab6c02d816}</Project>
|
||||
<Name>RGB.NET.Devices.Razer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Groups\RGB.NET.Groups.csproj">
|
||||
<Project>{2a39f859-aad0-4c16-94f8-78057820b376}</Project>
|
||||
<Name>RGB.NET.Groups</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Input.Corsair\RGB.NET.Input.Corsair.csproj">
|
||||
<Project>{f905c418-76bb-4ba6-88ab-0793bc2681d3}</Project>
|
||||
<Name>RGB.NET.Input.Corsair</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Input\RGB.NET.Input.csproj">
|
||||
<Project>{e60c3c6f-903f-4d80-99d0-7a1e50af5a9d}</Project>
|
||||
<Name>RGB.NET.Input</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj">
|
||||
<Project>{9b811f9b-86b9-4771-87af-72bae7078a36}</Project>
|
||||
<Name>Artemis.Core</Name>
|
||||
@@ -250,5 +241,17 @@
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Fody.2.3.17\build\net452\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.2.3.17\build\net452\Fody.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.26\build\net45\RGB.NET.Devices.Asus.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Asus.0.0.1.26\build\net45\RGB.NET.Devices.Asus.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.26\build\net45\RGB.NET.Devices.CoolerMaster.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.26\build\net45\RGB.NET.Devices.CoolerMaster.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.26\build\net45\RGB.NET.Devices.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Corsair.0.0.1.26\build\net45\RGB.NET.Devices.Corsair.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.26\build\net45\RGB.NET.Devices.Logitech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Logitech.0.0.1.26\build\net45\RGB.NET.Devices.Logitech.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.26\build\net45\RGB.NET.Devices.Msi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Msi.0.0.1.26\build\net45\RGB.NET.Devices.Msi.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.26\build\net45\RGB.NET.Devices.Razer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Razer.0.0.1.26\build\net45\RGB.NET.Devices.Razer.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\RGB.NET.Devices.Asus.0.0.1.26\build\net45\RGB.NET.Devices.Asus.targets" Condition="Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.26\build\net45\RGB.NET.Devices.Asus.targets')" />
|
||||
<Import Project="..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.26\build\net45\RGB.NET.Devices.CoolerMaster.targets" Condition="Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.26\build\net45\RGB.NET.Devices.CoolerMaster.targets')" />
|
||||
<Import Project="..\packages\RGB.NET.Devices.Corsair.0.0.1.26\build\net45\RGB.NET.Devices.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.26\build\net45\RGB.NET.Devices.Corsair.targets')" />
|
||||
<Import Project="..\packages\RGB.NET.Devices.Logitech.0.0.1.26\build\net45\RGB.NET.Devices.Logitech.targets" Condition="Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.26\build\net45\RGB.NET.Devices.Logitech.targets')" />
|
||||
<Import Project="..\packages\RGB.NET.Devices.Msi.0.0.1.26\build\net45\RGB.NET.Devices.Msi.targets" Condition="Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.26\build\net45\RGB.NET.Devices.Msi.targets')" />
|
||||
<Import Project="..\packages\RGB.NET.Devices.Razer.0.0.1.26\build\net45\RGB.NET.Devices.Razer.targets" Condition="Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.26\build\net45\RGB.NET.Devices.Razer.targets')" />
|
||||
</Project>
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace Artemis.UI.Controls.Visualizers
|
||||
@@ -32,5 +33,15 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,8 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
#endregion
|
||||
|
||||
#region Properties & Fields
|
||||
|
||||
private Canvas _canvas;
|
||||
|
||||
public Canvas Canvas { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
/// <inheritdoc />
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
_canvas = (Canvas) GetTemplateChild(PART_CANVAS);
|
||||
Canvas = (Canvas) GetTemplateChild(PART_CANVAS);
|
||||
|
||||
LayoutLeds();
|
||||
}
|
||||
@@ -63,14 +63,14 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
|
||||
private void LayoutLeds()
|
||||
{
|
||||
if (_canvas == null) return;
|
||||
if (Canvas == null) return;
|
||||
|
||||
_canvas.Children.Clear();
|
||||
Canvas.Children.Clear();
|
||||
|
||||
if (Device == null) return;
|
||||
|
||||
foreach (Led led in Device)
|
||||
_canvas.Children.Add(new LedVisualizer {Led = led});
|
||||
Canvas.Children.Add(new LedVisualizer {Led = led});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Artemis.UI.Adorners;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Groups;
|
||||
using Point = System.Windows.Point;
|
||||
|
||||
namespace Artemis.UI.Controls.Visualizers
|
||||
{
|
||||
@@ -22,6 +29,8 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
|
||||
private RGBSurface _surface;
|
||||
private Canvas _canvas;
|
||||
private BoundingBoxAdorner _boundingBox;
|
||||
private Point _startingPoint;
|
||||
|
||||
//TODO DarthAffe 17.06.2017: This is ugly - redesign how device connect/disconnect is generally handled!
|
||||
private readonly List<IRGBDevice> _newDevices = new List<IRGBDevice>();
|
||||
@@ -74,9 +83,70 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
/// <inheritdoc />
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
// Detach any existing event handlers
|
||||
if (_canvas != null)
|
||||
{
|
||||
_canvas.MouseLeftButtonDown -= ScrollViewerOnMouseLeftButtonDown;
|
||||
_canvas.MouseLeftButtonUp -= ScrollViewerOnMouseLeftButtonUp;
|
||||
}
|
||||
_canvas?.Children.Clear();
|
||||
_canvas = (Canvas)GetTemplateChild(PART_CANVAS);
|
||||
_canvas = (Canvas) GetTemplateChild(PART_CANVAS);
|
||||
|
||||
UpdateSurface();
|
||||
|
||||
if (_canvas == null) return;
|
||||
_canvas.MouseLeftButtonDown += ScrollViewerOnMouseLeftButtonDown;
|
||||
_canvas.MouseLeftButtonUp += ScrollViewerOnMouseLeftButtonUp;
|
||||
_canvas.MouseMove += ScrollViewerOnMouseMove;
|
||||
}
|
||||
|
||||
|
||||
private void ScrollViewerOnMouseLeftButtonDown(object sender, MouseButtonEventArgs mouseButtonEventArgs)
|
||||
{
|
||||
_canvas.CaptureMouse();
|
||||
_startingPoint = mouseButtonEventArgs.GetPosition(_canvas);
|
||||
_boundingBox = new BoundingBoxAdorner(_canvas, Colors.RoyalBlue);
|
||||
|
||||
var adornerLayer = AdornerLayer.GetAdornerLayer(_canvas);
|
||||
adornerLayer.Add(_boundingBox);
|
||||
}
|
||||
|
||||
private void ScrollViewerOnMouseLeftButtonUp(object sender, MouseButtonEventArgs mouseButtonEventArgs)
|
||||
{
|
||||
_canvas.ReleaseMouseCapture();
|
||||
var adornerLayer = AdornerLayer.GetAdornerLayer(_canvas);
|
||||
var adorners = adornerLayer.GetAdorners(_canvas);
|
||||
if (adorners == null) return;
|
||||
foreach (var adorner in adorners)
|
||||
adornerLayer.Remove(adorner);
|
||||
|
||||
_boundingBox = null;
|
||||
}
|
||||
|
||||
private void ScrollViewerOnMouseMove(object sender, MouseEventArgs mouseEventArgs)
|
||||
{
|
||||
if (_boundingBox == null) return;
|
||||
var currentPoint = mouseEventArgs.GetPosition(_canvas);
|
||||
_boundingBox.Update(_startingPoint, currentPoint);
|
||||
|
||||
var ledStart = new RGB.NET.Core.Point(_startingPoint.X, _startingPoint.Y);
|
||||
var ledEnd = new RGB.NET.Core.Point(currentPoint.X, currentPoint.Y);
|
||||
var selection = new RectangleLedGroup(ledStart, ledEnd, 0.1);
|
||||
|
||||
// Deselect all LED of each device
|
||||
var deviceLeds = new List<LedVisualizer>();
|
||||
foreach (var rgbDeviceVisualizer in _canvas.Children.Cast<RGBDeviceVisualizer>())
|
||||
deviceLeds.AddRange(rgbDeviceVisualizer.Canvas.Children.Cast<LedVisualizer>());
|
||||
|
||||
foreach (var ledVisualizer in deviceLeds)
|
||||
ledVisualizer?.Deselect();
|
||||
|
||||
// Select all LEDs in the bounding box
|
||||
foreach (var led in selection.GetLeds())
|
||||
{
|
||||
var ledVisualizer = deviceLeds.FirstOrDefault(l => l.Led == led);
|
||||
ledVisualizer?.Select();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateSurface()
|
||||
@@ -86,7 +156,7 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
if (_newDevices.Count > 0)
|
||||
{
|
||||
foreach (IRGBDevice device in _newDevices)
|
||||
_canvas.Children.Add(new RGBDeviceVisualizer { Device = device });
|
||||
_canvas.Children.Add(new RGBDeviceVisualizer {Device = device});
|
||||
_newDevices.Clear();
|
||||
}
|
||||
|
||||
@@ -96,4 +166,4 @@ namespace Artemis.UI.Controls.Visualizers
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#FFFFFF" />
|
||||
</Trigger>
|
||||
|
||||
|
||||
<DataTrigger Binding="{Binding Led.Shape, RelativeSource={RelativeSource Self}}" Value="Circle">
|
||||
<Setter Property="Template" Value="{StaticResource ControlTemplateLedCircle}" />
|
||||
</DataTrigger>
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type visualizers:RGBSurfaceVisualizer}">
|
||||
<ScrollViewer VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
<ScrollViewer x:Name="PART_ScrollViewer"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto">
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
Background="Transparent">
|
||||
<Border VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<packages>
|
||||
<package id="Castle.Core" version="4.2.1" targetFramework="net461" />
|
||||
<package id="Fody" version="2.3.17" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="HidSharp" version="1.5" targetFramework="net461" />
|
||||
<package id="MahApps.Metro" version="1.5.0" targetFramework="net461" />
|
||||
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net461" />
|
||||
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net461" />
|
||||
@@ -10,5 +11,21 @@
|
||||
<package id="Ninject.Extensions.Conventions" version="3.3.0" targetFramework="net461" />
|
||||
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net461" />
|
||||
<package id="PropertyChanged.Fody" version="2.2.4.0" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="RGB.NET" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Brushes" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Core" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Decorators" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Asus" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.CoolerMaster" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Corsair" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Logitech" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Msi" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Novation" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Razer" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Groups" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="RGB.NET.Presets" version="0.0.1.26" targetFramework="net461" />
|
||||
<package id="Sanford.Multimedia.Midi" version="6.4.1" targetFramework="net461" />
|
||||
<package id="Stylet" version="1.1.21" targetFramework="net461" />
|
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
|
||||
</packages>
|
||||
Reference in new issue
Block a user