1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Project cleanup

This commit is contained in:
SpoinkyNL 2018-03-04 22:29:04 +01:00
parent 2f72cdb1d9
commit 31affd01b3
30 changed files with 254 additions and 268 deletions

View File

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Artemis.Core.Attributes namespace Artemis.Core.Attributes
{ {

View File

@ -1,10 +1,4 @@
using System; namespace Artemis.Core.Models
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Artemis.Core.Models
{ {
public class DataModelDescription public class DataModelDescription
{ {

View File

@ -1,9 +1,4 @@
using System.Linq; using Artemis.Core.Services.Interfaces;
using System.Reflection;
using Artemis.Core.Services.Interfaces;
using Artemis.Plugins.Interfaces;
using Artemis.Plugins.Models;
using Newtonsoft.Json;
using Ninject.Extensions.Conventions; using Ninject.Extensions.Conventions;
using Ninject.Modules; using Ninject.Modules;

View File

@ -10,8 +10,8 @@ namespace Artemis.Core.Services
{ {
public class CoreService : ICoreService public class CoreService : ICoreService
{ {
private readonly IRgbService _rgbService;
private readonly IPluginService _pluginService; private readonly IPluginService _pluginService;
private readonly IRgbService _rgbService;
public CoreService(IPluginService pluginService, IRgbService rgbService) public CoreService(IPluginService pluginService, IRgbService rgbService)
{ {

View File

@ -1,19 +1,14 @@
using System; using System;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Artemis.Core.Events; using Artemis.Core.Events;
using Artemis.Core.Services.Interfaces; using Artemis.Core.Services.Interfaces;
using RGB.NET.Brushes;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.Asus;
using RGB.NET.Devices.CoolerMaster; using RGB.NET.Devices.CoolerMaster;
using RGB.NET.Devices.Corsair; using RGB.NET.Devices.Corsair;
using RGB.NET.Devices.DMX; using RGB.NET.Devices.DMX;
using RGB.NET.Devices.Logitech; using RGB.NET.Devices.Logitech;
using RGB.NET.Devices.Msi;
using RGB.NET.Devices.Novation; using RGB.NET.Devices.Novation;
using RGB.NET.Devices.Razer; using RGB.NET.Devices.Razer;
using RGB.NET.Groups;
namespace Artemis.Core.Services namespace Artemis.Core.Services
{ {

View File

@ -28,7 +28,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -52,7 +53,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Castle.Core" version="4.2.1" targetFramework="net46" /> <package id="Castle.Core" version="4.2.1" targetFramework="net46" />
<package id="HidSharp" version="1.5" targetFramework="net46" /> <package id="HidSharp" version="1.5" targetFramework="net46" />

View File

@ -1,5 +1,4 @@
using System; using Artemis.Core.Attributes;
using Artemis.Core.Attributes;
using Artemis.Plugins.Interfaces; using Artemis.Plugins.Interfaces;
namespace Artemis.Plugins.BuiltIn.Modules.General namespace Artemis.Plugins.BuiltIn.Modules.General

View File

@ -1,5 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -15,7 +16,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -59,7 +61,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Stylet" version="1.1.21" targetFramework="net461" /> <package id="Stylet" version="1.1.21" targetFramework="net461" />
</packages> </packages>

View File

@ -1,5 +1,4 @@
using System; using System;
using Ninject;
namespace Artemis.Plugins.Interfaces namespace Artemis.Plugins.Interfaces
{ {

View File

@ -2,6 +2,5 @@
{ {
public interface IModuleDataModel public interface IModuleDataModel
{ {
} }
} }

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -19,7 +20,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -43,7 +45,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CS-Script.bin" version="3.28.0.1" targetFramework="net46" /> <package id="CS-Script.bin" version="3.28.0.1" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net46" /> <package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net46" />

View File

@ -1,6 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace Artemis.Storage.Migrations namespace Artemis.Storage.Migrations
{ {
@ -9,8 +7,8 @@ namespace Artemis.Storage.Migrations
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Folders", "Folders",
columns: table => new table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
@ -22,28 +20,25 @@ namespace Artemis.Storage.Migrations
{ {
table.PrimaryKey("PK_Folders", x => x.Id); table.PrimaryKey("PK_Folders", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_Folders_Folders_FolderEntityId", "FK_Folders_Folders_FolderEntityId",
column: x => x.FolderEntityId, x => x.FolderEntityId,
principalTable: "Folders", "Folders",
principalColumn: "Id", "Id",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Settings", "Settings",
columns: table => new table => new
{ {
Name = table.Column<string>(nullable: false), Name = table.Column<string>(nullable: false),
Value = table.Column<string>(nullable: true) Value = table.Column<string>(nullable: true)
}, },
constraints: table => constraints: table => { table.PrimaryKey("PK_Settings", x => x.Name); });
{
table.PrimaryKey("PK_Settings", x => x.Name);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Layers", "Layers",
columns: table => new table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
@ -56,16 +51,16 @@ namespace Artemis.Storage.Migrations
{ {
table.PrimaryKey("PK_Layers", x => x.Id); table.PrimaryKey("PK_Layers", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_Layers_Folders_FolderEntityId", "FK_Layers_Folders_FolderEntityId",
column: x => x.FolderEntityId, x => x.FolderEntityId,
principalTable: "Folders", "Folders",
principalColumn: "Id", "Id",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Profiles", "Profiles",
columns: table => new table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
@ -77,16 +72,16 @@ namespace Artemis.Storage.Migrations
{ {
table.PrimaryKey("PK_Profiles", x => x.Id); table.PrimaryKey("PK_Profiles", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_Profiles_Folders_RootFolderId", "FK_Profiles_Folders_RootFolderId",
column: x => x.RootFolderId, x => x.RootFolderId,
principalTable: "Folders", "Folders",
principalColumn: "Id", "Id",
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "LayerSettings", "LayerSettings",
columns: table => new table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
@ -98,16 +93,16 @@ namespace Artemis.Storage.Migrations
{ {
table.PrimaryKey("PK_LayerSettings", x => x.Id); table.PrimaryKey("PK_LayerSettings", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_LayerSettings_Layers_LayerEntityId", "FK_LayerSettings_Layers_LayerEntityId",
column: x => x.LayerEntityId, x => x.LayerEntityId,
principalTable: "Layers", "Layers",
principalColumn: "Id", "Id",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Leds", "Leds",
columns: table => new table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
@ -119,16 +114,16 @@ namespace Artemis.Storage.Migrations
{ {
table.PrimaryKey("PK_Leds", x => x.Id); table.PrimaryKey("PK_Leds", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_Leds_Layers_LayerId", "FK_Leds_Layers_LayerId",
column: x => x.LayerId, x => x.LayerId,
principalTable: "Layers", "Layers",
principalColumn: "Id", "Id",
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Keypoints", "Keypoints",
columns: table => new table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true), .Annotation("Sqlite:Autoincrement", true),
@ -140,66 +135,66 @@ namespace Artemis.Storage.Migrations
{ {
table.PrimaryKey("PK_Keypoints", x => x.Id); table.PrimaryKey("PK_Keypoints", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_Keypoints_LayerSettings_LayerSettingEntityId", "FK_Keypoints_LayerSettings_LayerSettingEntityId",
column: x => x.LayerSettingEntityId, x => x.LayerSettingEntityId,
principalTable: "LayerSettings", "LayerSettings",
principalColumn: "Id", "Id",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Folders_FolderEntityId", "IX_Folders_FolderEntityId",
table: "Folders", "Folders",
column: "FolderEntityId"); "FolderEntityId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Keypoints_LayerSettingEntityId", "IX_Keypoints_LayerSettingEntityId",
table: "Keypoints", "Keypoints",
column: "LayerSettingEntityId"); "LayerSettingEntityId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Layers_FolderEntityId", "IX_Layers_FolderEntityId",
table: "Layers", "Layers",
column: "FolderEntityId"); "FolderEntityId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_LayerSettings_LayerEntityId", "IX_LayerSettings_LayerEntityId",
table: "LayerSettings", "LayerSettings",
column: "LayerEntityId"); "LayerEntityId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Leds_LayerId", "IX_Leds_LayerId",
table: "Leds", "Leds",
column: "LayerId"); "LayerId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Profiles_RootFolderId", "IX_Profiles_RootFolderId",
table: "Profiles", "Profiles",
column: "RootFolderId"); "RootFolderId");
} }
protected override void Down(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Keypoints"); "Keypoints");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Leds"); "Leds");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Profiles"); "Profiles");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Settings"); "Settings");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "LayerSettings"); "LayerSettings");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Layers"); "Layers");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Folders"); "Folders");
} }
} }
} }

View File

@ -1,16 +1,12 @@
// <auto-generated /> // <auto-generated />
using Artemis.Storage;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using System;
namespace Artemis.Storage.Migrations namespace Artemis.Storage.Migrations
{ {
[DbContext(typeof(StorageContext))] [DbContext(typeof(StorageContext))]
partial class StorageContextModelSnapshot : ModelSnapshot internal class StorageContextModelSnapshot : ModelSnapshot
{ {
protected override void BuildModel(ModelBuilder modelBuilder) protected override void BuildModel(ModelBuilder modelBuilder)
{ {

View File

@ -31,7 +31,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -55,7 +56,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.CodeAnalysis.CSharp.Scripting" publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>

View File

@ -31,9 +31,9 @@
Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Teal.xaml" /> Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Teal.xaml" />
<!-- Artemis --> <!-- Artemis -->
<ResourceDictionary Source="Styles/Visualizers/RGBSurfaceVisualizer.xaml"></ResourceDictionary> <ResourceDictionary Source="Styles/Visualizers/RGBSurfaceVisualizer.xaml" />
<ResourceDictionary Source="Styles/Visualizers/RGBDeviceVisualizer.xaml"></ResourceDictionary> <ResourceDictionary Source="Styles/Visualizers/RGBDeviceVisualizer.xaml" />
<ResourceDictionary Source="Styles/Visualizers/LedVisualizer.xaml"></ResourceDictionary> <ResourceDictionary Source="Styles/Visualizers/LedVisualizer.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<!-- MahApps Brushes --> <!-- MahApps Brushes -->

View File

@ -11,6 +11,16 @@ namespace Artemis.UI.Controls.Visualizers
/// </summary> /// </summary>
public class LedVisualizer : Control public class LedVisualizer : Control
{ {
public void Select()
{
BorderBrush = new SolidColorBrush(Colors.RoyalBlue);
}
public void Deselect()
{
BorderBrush = new SolidColorBrush(Colors.Black);
}
#region DependencyProperties #region DependencyProperties
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
@ -33,15 +43,5 @@ namespace Artemis.UI.Controls.Visualizers
// ReSharper restore InconsistentNaming // ReSharper restore InconsistentNaming
#endregion #endregion
public void Select()
{
BorderBrush = new SolidColorBrush(Colors.RoyalBlue);
}
public void Deselect()
{
BorderBrush = new SolidColorBrush(Colors.Black);
}
} }
} }

View File

@ -69,7 +69,7 @@ namespace Artemis.UI.Controls.Visualizers
if (Device == null) return; if (Device == null) return;
foreach (Led led in Device) foreach (var led in Device)
Canvas.Children.Add(new LedVisualizer {Led = led}); Canvas.Children.Add(new LedVisualizer {Led = led});
} }

View File

@ -45,8 +45,8 @@ namespace Artemis.UI.Controls.Visualizers
/// </summary> /// </summary>
public RGBSurfaceVisualizer() public RGBSurfaceVisualizer()
{ {
this.Loaded += OnLoaded; Loaded += OnLoaded;
this.Unloaded += OnUnloaded; Unloaded += OnUnloaded;
} }
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
@ -54,7 +54,7 @@ namespace Artemis.UI.Controls.Visualizers
_surface = RGBSurface.Instance; _surface = RGBSurface.Instance;
_surface.SurfaceLayoutChanged += RGBSurfaceOnSurfaceLayoutChanged; _surface.SurfaceLayoutChanged += RGBSurfaceOnSurfaceLayoutChanged;
foreach (IRGBDevice device in _surface.Devices) foreach (var device in _surface.Devices)
_newDevices.Add(device); _newDevices.Add(device);
UpdateSurface(); UpdateSurface();
@ -70,7 +70,7 @@ namespace Artemis.UI.Controls.Visualizers
private void RGBSurfaceOnSurfaceLayoutChanged(SurfaceLayoutChangedEventArgs args) private void RGBSurfaceOnSurfaceLayoutChanged(SurfaceLayoutChangedEventArgs args)
{ {
if (args.DeviceAdded) if (args.DeviceAdded)
foreach (IRGBDevice device in args.Devices) foreach (var device in args.Devices)
_newDevices.Add(device); _newDevices.Add(device);
UpdateSurface(); UpdateSurface();
@ -89,6 +89,7 @@ namespace Artemis.UI.Controls.Visualizers
_canvas.MouseLeftButtonDown -= ScrollViewerOnMouseLeftButtonDown; _canvas.MouseLeftButtonDown -= ScrollViewerOnMouseLeftButtonDown;
_canvas.MouseLeftButtonUp -= ScrollViewerOnMouseLeftButtonUp; _canvas.MouseLeftButtonUp -= ScrollViewerOnMouseLeftButtonUp;
} }
_canvas?.Children.Clear(); _canvas?.Children.Clear();
_canvas = (Canvas) GetTemplateChild(PART_CANVAS); _canvas = (Canvas) GetTemplateChild(PART_CANVAS);
@ -151,11 +152,11 @@ namespace Artemis.UI.Controls.Visualizers
private void UpdateSurface() private void UpdateSurface()
{ {
if ((_canvas == null) || (_surface == null)) return; if (_canvas == null || _surface == null) return;
if (_newDevices.Count > 0) if (_newDevices.Count > 0)
{ {
foreach (IRGBDevice device in _newDevices) foreach (var device in _newDevices)
_canvas.Children.Add(new RGBDeviceVisualizer {Device = device}); _canvas.Children.Add(new RGBDeviceVisualizer {Device = device});
_newDevices.Clear(); _newDevices.Clear();
} }

View File

@ -2,6 +2,7 @@
using System.Globalization; using System.Globalization;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Media; using System.Windows.Media;
using Color = RGB.NET.Core.Color;
namespace Artemis.UI.Converters namespace Artemis.UI.Converters
{ {
@ -9,23 +10,23 @@ namespace Artemis.UI.Converters
/// <summary> /// <summary>
/// Converts <see cref="T:RGB.NET.Core.Color" /> into <see cref="T:System.Windows.Media.SolidColorBrush" />. /// Converts <see cref="T:RGB.NET.Core.Color" /> into <see cref="T:System.Windows.Media.SolidColorBrush" />.
/// </summary> /// </summary>
[ValueConversion(typeof(RGB.NET.Core.Color), typeof(SolidColorBrush))] [ValueConversion(typeof(Color), typeof(SolidColorBrush))]
public class ColorToSolidColorBrushConverter : IValueConverter public class ColorToSolidColorBrushConverter : IValueConverter
{ {
/// <inheritdoc /> /// <inheritdoc />
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
return new SolidColorBrush(!(value is RGB.NET.Core.Color color) return new SolidColorBrush(!(value is Color color)
? Color.FromArgb(0, 0, 0, 0) ? System.Windows.Media.Color.FromArgb(0, 0, 0, 0)
: Color.FromArgb(color.A, color.R, color.G, color.B)); : System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B));
} }
/// <inheritdoc /> /// <inheritdoc />
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{ {
return !(value is SolidColorBrush brush) return !(value is SolidColorBrush brush)
? RGB.NET.Core.Color.Transparent ? Color.Transparent
: new RGB.NET.Core.Color(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B); : new Color(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B);
} }
} }
} }

View File

@ -3,6 +3,5 @@
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public interface IArtemisUIService public interface IArtemisUIService
{ {
} }
} }

View File

@ -67,11 +67,14 @@
<Style x:Key="StyleLedVisualizer" TargetType="{x:Type controls:LedVisualizer}"> <Style x:Key="StyleLedVisualizer" TargetType="{x:Type controls:LedVisualizer}">
<Setter Property="Width" Value="{Binding Led.LedRectangle.Size.Width, RelativeSource={RelativeSource Self}}" /> <Setter Property="Width" Value="{Binding Led.LedRectangle.Size.Width, RelativeSource={RelativeSource Self}}" />
<Setter Property="Height" Value="{Binding Led.LedRectangle.Size.Height, RelativeSource={RelativeSource Self}}" /> <Setter Property="Height" Value="{Binding Led.LedRectangle.Size.Height, RelativeSource={RelativeSource Self}}" />
<Setter Property="Canvas.Left" Value="{Binding Led.LedRectangle.Location.X, RelativeSource={RelativeSource Self}}" /> <Setter Property="Canvas.Left"
<Setter Property="Canvas.Top" Value="{Binding Led.LedRectangle.Location.Y, RelativeSource={RelativeSource Self}}" /> Value="{Binding Led.LedRectangle.Location.X, RelativeSource={RelativeSource Self}}" />
<Setter Property="Canvas.Top"
Value="{Binding Led.LedRectangle.Location.Y, RelativeSource={RelativeSource Self}}" />
<Setter Property="BorderBrush" Value="#000000" /> <Setter Property="BorderBrush" Value="#000000" />
<Setter Property="Background" Value="{Binding Led.Color, RelativeSource={RelativeSource Self}, <Setter Property="Background"
Value="{Binding Led.Color, RelativeSource={RelativeSource Self},
Converter={StaticResource ConverterColorToSolidColorBrush}}" /> Converter={StaticResource ConverterColorToSolidColorBrush}}" />
<Setter Property="Template" Value="{StaticResource ControlTemplateLedRectangle}" /> <Setter Property="Template" Value="{StaticResource ControlTemplateLedRectangle}" />

View File

@ -8,7 +8,8 @@
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" /> <ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Castle.Core" version="4.2.1" targetFramework="net461" /> <package id="Castle.Core" version="4.2.1" targetFramework="net461" />
<package id="ControlzEx" version="3.0.2.4" targetFramework="net461" /> <package id="ControlzEx" version="3.0.2.4" targetFramework="net461" />