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

Code cleanup

This commit is contained in:
Robert 2019-11-13 19:57:23 +01:00
parent 44eaa6ac40
commit 5340e6c6d4
70 changed files with 492 additions and 488 deletions

View File

@ -8,7 +8,7 @@ namespace Artemis.Core.Extensions
{
if (type == null)
return false;
return type.BaseType?.GetGenericTypeDefinition() == genericType;
}
}

View File

@ -3,7 +3,6 @@ using System.Drawing;
using Artemis.Core.Models.Profile.Interfaces;
using Artemis.Core.Services.Interfaces;
using Artemis.Storage.Entities;
using RGB.NET.Core;
namespace Artemis.Core.Models.Profile
{

View File

@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Drawing;
using RGB.NET.Core;
namespace Artemis.Core.Models.Profile.Interfaces
{

View File

@ -6,7 +6,6 @@ using Artemis.Core.Models.Profile.Interfaces;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
using Artemis.Storage.Entities;
using RGB.NET.Core;
namespace Artemis.Core.Models.Profile
{

View File

@ -1,13 +1,11 @@
using System;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using Artemis.Core.Extensions;
using Artemis.Core.Plugins.Abstract;
using Artemis.Storage.Entities;
using RGB.NET.Core;
using Point = RGB.NET.Core.Point;
using Rectangle = System.Drawing.Rectangle;
namespace Artemis.Core.Models.Surface
@ -104,12 +102,12 @@ namespace Artemis.Core.Models.Surface
foreach (var led in Leds)
led.CalculateRenderRectangle();
var path = new GraphicsPath();
path.AddRectangles(Leds.Select(l => l.AbsoluteRenderRectangle).ToArray());
RenderPath = path;
}
internal void Destroy()
{
Configuration = null;

View File

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.Core.Extensions;
using Artemis.Storage.Entities;
using RGB.NET.Core;

View File

@ -1,9 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.IO;
using Artemis.Core.Exceptions;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.Storage.Repositories.Interfaces;
using Ninject.Activation;

View File

@ -8,8 +8,8 @@ namespace Artemis.Core.Ninject
private static readonly ILogger _logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.Enrich.WithDemystifiedStackTraces()
.WriteTo.File("Logs/Artemis log-.txt",
rollingInterval: RollingInterval.Day,
.WriteTo.File("Logs/Artemis log-.txt",
rollingInterval: RollingInterval.Day,
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext:l}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
@ -19,7 +19,6 @@ namespace Artemis.Core.Ninject
if (requestingType != null)
return _logger.ForContext(requestingType);
return _logger;
}
}
}

View File

@ -25,6 +25,5 @@ namespace Artemis.Core.Ninject
return _instance;
}
}
}

View File

@ -12,13 +12,13 @@ namespace Artemis.Core.Plugins.Abstract
/// </summary>
public abstract class Device : Plugin
{
public IRGBDeviceProvider DeviceProvider { get; }
protected Device(PluginInfo pluginInfo, IRGBDeviceProvider deviceProvider) : base(pluginInfo)
{
DeviceProvider = deviceProvider ?? throw new ArgumentNullException(nameof(deviceProvider));
}
public IRGBDeviceProvider DeviceProvider { get; }
protected void ResolveAbsolutePath(Type type, object sender, ResolvePathEventArgs e)
{

View File

@ -2,7 +2,6 @@
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Models;
using RGB.NET.Core;
namespace Artemis.Core.Plugins.Abstract
{

View File

@ -2,8 +2,6 @@
using System.Drawing;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Models;
using RGB.NET.Core;
using Stylet;
namespace Artemis.Core.Plugins.Abstract
{

View File

@ -1,5 +1,4 @@
using System;
using System.Threading.Tasks;
using Artemis.Core.Plugins.Models;
namespace Artemis.Core.Plugins.Abstract
@ -17,6 +16,12 @@ namespace Artemis.Core.Plugins.Abstract
public PluginInfo PluginInfo { get; internal set; }
/// <inheritdoc />
/// <summary>
/// Called when the plugin is unloaded, clean up any unmanaged resources here
/// </summary>
public abstract void Dispose();
/// <summary>
/// Called when the plugin is activated
/// </summary>
@ -26,11 +31,5 @@ namespace Artemis.Core.Plugins.Abstract
/// Called when the plugin is deactivated
/// </summary>
public abstract void DisablePlugin();
/// <inheritdoc />
/// <summary>
/// Called when the plugin is unloaded, clean up any unmanaged resources here
/// </summary>
public abstract void Dispose();
}
}

View File

@ -3,7 +3,6 @@ using System.Drawing;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Models;
using RGB.NET.Core;
namespace Artemis.Core.Plugins.Abstract
{

View File

@ -1,10 +1,8 @@
using System;
using System.ComponentModel;
using System.Threading.Tasks;
using Artemis.Storage.Entities;
using Artemis.Storage.Repositories.Interfaces;
using Newtonsoft.Json;
using Stylet;
namespace Artemis.Core.Plugins.Models
{

View File

@ -50,6 +50,7 @@ namespace Artemis.Core.RGB.NET
return result;
}
return Color.Black;
}
}

View File

@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Artemis.Core.Events;
using Artemis.Core.Exceptions;
@ -101,6 +100,16 @@ namespace Artemis.Core.Services
OnFrameRendered(new FrameRenderedEventArgs(_rgbService.GraphicsDecorator.GetBitmap(), _rgbService.Surface));
}
protected virtual void OnFrameRendering(FrameRenderingEventArgs e)
{
FrameRendering?.Invoke(this, e);
}
protected virtual void OnFrameRendered(FrameRenderedEventArgs e)
{
FrameRendered?.Invoke(this, e);
}
#region Events
public event EventHandler Initialized;
@ -114,15 +123,5 @@ namespace Artemis.Core.Services
}
#endregion
protected virtual void OnFrameRendering(FrameRenderingEventArgs e)
{
FrameRendering?.Invoke(this, e);
}
protected virtual void OnFrameRendered(FrameRenderedEventArgs e)
{
FrameRendered?.Invoke(this, e);
}
}
}

View File

@ -1,6 +1,5 @@
using Artemis.Core.Models;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Interfaces;
namespace Artemis.Core.Services.Interfaces
{

View File

@ -74,7 +74,7 @@ namespace Artemis.Core.Services.Interfaces
#region Events
/// <summary>
/// Occurs when built-in plugins are being loaded
/// Occurs when built-in plugins are being loaded
/// </summary>
event EventHandler CopyingBuildInPlugins;

View File

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Events;
using Artemis.Core.Models.Surface;
using Artemis.Core.RGB.NET;
using RGB.NET.Core;

View File

@ -63,19 +63,18 @@ namespace Artemis.Core.Services
// Find the matching plugin in the plugin folder
var match = pluginDirectory.EnumerateDirectories().FirstOrDefault(d => d.Name == subDirectory.Name);
if (match == null)
{
CopyBuiltInPlugin(subDirectory);
}
else
{
var metadataFile = Path.Combine(match.FullName, "plugin.json");
if (!File.Exists(metadataFile))
{
_logger.Information("Copying missing built-in plugin {name} version: {version}",
_logger.Information("Copying missing built-in plugin {name} version: {version}",
builtInPluginInfo.Name, builtInPluginInfo.Version);
CopyBuiltInPlugin(subDirectory);
}
else
{
try
{
// Compare versions, copy if the same when debugging
@ -83,7 +82,7 @@ namespace Artemis.Core.Services
#if DEBUG
if (builtInPluginInfo.Version >= pluginInfo.Version)
{
_logger.Information("Copying updated built-in plugin {name} version: {version} (old version: {oldVersion})",
_logger.Information("Copying updated built-in plugin {name} version: {version} (old version: {oldVersion})",
builtInPluginInfo.Name, builtInPluginInfo.Version, pluginInfo.Version);
CopyBuiltInPlugin(subDirectory);
}
@ -100,6 +99,7 @@ namespace Artemis.Core.Services
{
throw new ArtemisPluginException("Failed read plugin metadata needed to install built-in plugin", e);
}
}
}
}
}
@ -128,10 +128,7 @@ namespace Artemis.Core.Services
{
// Load the metadata
var metadataFile = Path.Combine(subDirectory.FullName, "plugin.json");
if (!File.Exists(metadataFile))
{
_logger.Warning(new ArtemisPluginException("Couldn't find the plugins metadata file at " + metadataFile), "Plugin exception");
}
if (!File.Exists(metadataFile)) _logger.Warning(new ArtemisPluginException("Couldn't find the plugins metadata file at " + metadataFile), "Plugin exception");
// Locate the main entry
var pluginInfo = JsonConvert.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile));

View File

@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.Core.Events;
using Artemis.Core.Plugins.Models;
using Artemis.Core.RGB.NET;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.Services.Storage;
using RGB.NET.Brushes;
using RGB.NET.Core;
using RGB.NET.Groups;
@ -20,10 +18,10 @@ namespace Artemis.Core.Services
{
private readonly List<IRGBDevice> _loadedDevices;
private readonly ILogger _logger;
private readonly TimerUpdateTrigger _updateTrigger;
private ListLedGroup _background;
private readonly PluginSetting<double> _renderScaleSetting;
private readonly PluginSetting<int> _targetFrameRateSetting;
private readonly TimerUpdateTrigger _updateTrigger;
private ListLedGroup _background;
internal RgbService(ILogger logger, ISettingsService settingsService)
{
@ -40,7 +38,6 @@ namespace Artemis.Core.Services
_loadedDevices = new List<IRGBDevice>();
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / _targetFrameRateSetting.Value};
Surface.RegisterUpdateTrigger(_updateTrigger);
}
/// <inheritdoc />
@ -68,9 +65,7 @@ namespace Artemis.Core.Services
OnDeviceLoaded(new DeviceEventArgs(surfaceDevice));
}
else
{
OnDeviceReloaded(new DeviceEventArgs(surfaceDevice));
}
}
}
@ -91,7 +86,7 @@ namespace Artemis.Core.Services
{
_updateTrigger.UpdateFrequency = 1.0 / _targetFrameRateSetting.Value;
}
private void SurfaceOnException(ExceptionEventArgs args)
{
_logger.Warning("Surface threw e");

View File

@ -17,11 +17,11 @@ namespace Artemis.Core.Services.Storage
public class SurfaceService : ISurfaceService
{
private readonly ILogger _logger;
private readonly IRgbService _rgbService;
private readonly IPluginService _pluginService;
private readonly PluginSetting<double> _renderScaleSetting;
private readonly IRgbService _rgbService;
private readonly List<Surface> _surfaceConfigurations;
private readonly ISurfaceRepository _surfaceRepository;
private readonly PluginSetting<double> _renderScaleSetting;
internal SurfaceService(ILogger logger, ISurfaceRepository surfaceRepository, IRgbService rgbService, IPluginService pluginService, ISettingsService settingsService)
{
@ -128,27 +128,6 @@ namespace Artemis.Core.Services.Storage
}
}
#region Event handlers
private void RgbServiceOnDeviceLoaded(object sender, DeviceEventArgs e)
{
lock (_surfaceConfigurations)
{
foreach (var surfaceConfiguration in _surfaceConfigurations)
AddDeviceIfMissing(e.Device, surfaceConfiguration);
}
UpdateSurfaceConfiguration(ActiveSurface, true);
}
private void RenderScaleSettingOnSettingChanged(object sender, EventArgs e)
{
foreach (var surfaceConfiguration in SurfaceConfigurations)
surfaceConfiguration.UpdateScale(_renderScaleSetting.Value);
}
#endregion
#region Repository
private void LoadFromRepository()
@ -225,6 +204,27 @@ namespace Artemis.Core.Services.Storage
#endregion
#region Event handlers
private void RgbServiceOnDeviceLoaded(object sender, DeviceEventArgs e)
{
lock (_surfaceConfigurations)
{
foreach (var surfaceConfiguration in _surfaceConfigurations)
AddDeviceIfMissing(e.Device, surfaceConfiguration);
}
UpdateSurfaceConfiguration(ActiveSurface, true);
}
private void RenderScaleSettingOnSettingChanged(object sender, EventArgs e)
{
foreach (var surfaceConfiguration in SurfaceConfigurations)
surfaceConfiguration.UpdateScale(_renderScaleSetting.Value);
}
#endregion
#region Events
public event EventHandler<SurfaceConfigurationEventArgs> ActiveSurfaceConfigurationChanged;

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -27,7 +28,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</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.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
@ -51,7 +53,8 @@
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</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-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
@ -67,7 +70,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
@ -83,7 +87,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
@ -91,7 +96,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly>
<dependentAssembly>
@ -107,4 +113,4 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
</configuration>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AppDomainToolkit" version="1.0.4.3" targetFramework="net461" />
<package id="Ben.Demystifier" version="0.1.4" targetFramework="net472" />

View File

@ -1,5 +1,4 @@
using System.IO;
using Artemis.Core.Extensions;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
@ -25,7 +24,7 @@ namespace Artemis.Plugins.Devices.Corsair
CorsairDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "CUESDK.dll"));
_rgbService.AddDeviceProvider(DeviceProvider);
}
public override void DisablePlugin()
{
// TODO: Remove the device provider from the surface

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@ -33,4 +32,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -15,7 +16,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>

View File

@ -7,4 +7,4 @@
"Build": 0
},
"Main": "Artemis.Plugins.Devices.Corsair.dll"
}
}

View File

@ -1,6 +1,4 @@
using System;
using System.IO;
using Artemis.Core.Extensions;
using System.IO;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
@ -25,7 +23,7 @@ namespace Artemis.Plugins.Devices.Logitech
LogitechDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "LogitechLedEnginesWrapper.dll"));
_rgbService.AddDeviceProvider(DeviceProvider);
}
public override void DisablePlugin()
{
}

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
@ -33,4 +32,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -7,4 +7,4 @@
"Build": 0
},
"Main": "Artemis.Plugins.Devices.Logitech.dll"
}
}

View File

@ -4,7 +4,6 @@ using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using QRCoder;
using RGB.NET.Core;
namespace Artemis.Plugins.LayerTypes.Brush
{

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -15,7 +16,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
@ -32,4 +34,7 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

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

View File

@ -7,4 +7,4 @@
"Build": 0
},
"Main": "Artemis.Plugins.LayerTypes.Brush.dll"
}
}

View File

@ -1,6 +1,5 @@
using Artemis.Core.Attributes;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Interfaces;
namespace Artemis.Plugins.Modules.General
{

View File

@ -1,5 +1,4 @@
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Interfaces;
namespace Artemis.Plugins.Modules.General.ViewModels
{

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@ -15,7 +16,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
@ -32,4 +34,7 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

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

View File

@ -7,4 +7,4 @@
"Build": 0
},
"Main": "Artemis.Plugins.Modules.General.dll"
}
}

View File

@ -1,5 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Artemis.Storage.Entities
{
@ -7,7 +6,7 @@ namespace Artemis.Storage.Entities
{
public Guid PluginGuid { get; set; }
public string Name { get; set; }
public string Value { get; set; }
}
}

View File

@ -8,11 +8,11 @@ namespace Artemis.Storage.Migrations
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Folders",
columns: table => new
"Folders",
table => new
{
Guid = table.Column<string>(nullable: false),
Order = table.Column<int>(nullable: false),
Guid = table.Column<string>(),
Order = table.Column<int>(),
Name = table.Column<string>(nullable: true),
FolderEntityGuid = table.Column<string>(nullable: true)
},
@ -20,57 +20,48 @@ namespace Artemis.Storage.Migrations
{
table.PrimaryKey("PK_Folders", x => x.Guid);
table.ForeignKey(
name: "FK_Folders_Folders_FolderEntityGuid",
column: x => x.FolderEntityGuid,
principalTable: "Folders",
principalColumn: "Guid",
"FK_Folders_Folders_FolderEntityGuid",
x => x.FolderEntityGuid,
"Folders",
"Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "PluginSettings",
columns: table => new
"PluginSettings",
table => new
{
PluginGuid = table.Column<Guid>(nullable: false),
Name = table.Column<string>(nullable: false),
PluginGuid = table.Column<Guid>(),
Name = table.Column<string>(),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PluginSettings", x => new { x.Name, x.PluginGuid });
});
constraints: table => { table.PrimaryKey("PK_PluginSettings", x => new {x.Name, x.PluginGuid}); });
migrationBuilder.CreateTable(
name: "Settings",
columns: table => new
"Settings",
table => new
{
Name = table.Column<string>(nullable: false),
Name = table.Column<string>(),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Settings", x => x.Name);
});
constraints: table => { table.PrimaryKey("PK_Settings", x => x.Name); });
migrationBuilder.CreateTable(
name: "Surfaces",
columns: table => new
"Surfaces",
table => new
{
Guid = table.Column<string>(nullable: false),
Guid = table.Column<string>(),
Name = table.Column<string>(nullable: true),
IsActive = table.Column<bool>(nullable: false)
IsActive = table.Column<bool>()
},
constraints: table =>
{
table.PrimaryKey("PK_Surfaces", x => x.Guid);
});
constraints: table => { table.PrimaryKey("PK_Surfaces", x => x.Guid); });
migrationBuilder.CreateTable(
name: "Layers",
columns: table => new
"Layers",
table => new
{
Guid = table.Column<string>(nullable: false),
Order = table.Column<int>(nullable: false),
Guid = table.Column<string>(),
Order = table.Column<int>(),
Name = table.Column<string>(nullable: true),
FolderEntityGuid = table.Column<string>(nullable: true)
},
@ -78,62 +69,62 @@ namespace Artemis.Storage.Migrations
{
table.PrimaryKey("PK_Layers", x => x.Guid);
table.ForeignKey(
name: "FK_Layers_Folders_FolderEntityGuid",
column: x => x.FolderEntityGuid,
principalTable: "Folders",
principalColumn: "Guid",
"FK_Layers_Folders_FolderEntityGuid",
x => x.FolderEntityGuid,
"Folders",
"Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Profiles",
columns: table => new
"Profiles",
table => new
{
Guid = table.Column<string>(nullable: false),
PluginGuid = table.Column<Guid>(nullable: false),
Guid = table.Column<string>(),
PluginGuid = table.Column<Guid>(),
Name = table.Column<string>(nullable: true),
RootFolderId = table.Column<int>(nullable: false),
RootFolderId = table.Column<int>(),
RootFolderGuid = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Profiles", x => x.Guid);
table.ForeignKey(
name: "FK_Profiles_Folders_RootFolderGuid",
column: x => x.RootFolderGuid,
principalTable: "Folders",
principalColumn: "Guid",
"FK_Profiles_Folders_RootFolderGuid",
x => x.RootFolderGuid,
"Folders",
"Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "DeviceEntity",
columns: table => new
"DeviceEntity",
table => new
{
Guid = table.Column<string>(nullable: false),
DeviceHashCode = table.Column<int>(nullable: false),
X = table.Column<double>(nullable: false),
Y = table.Column<double>(nullable: false),
Rotation = table.Column<double>(nullable: false),
ZIndex = table.Column<int>(nullable: false),
Guid = table.Column<string>(),
DeviceHashCode = table.Column<int>(),
X = table.Column<double>(),
Y = table.Column<double>(),
Rotation = table.Column<double>(),
ZIndex = table.Column<int>(),
SurfaceId = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceEntity", x => x.Guid);
table.ForeignKey(
name: "FK_DeviceEntity_Surfaces_SurfaceId",
column: x => x.SurfaceId,
principalTable: "Surfaces",
principalColumn: "Guid",
"FK_DeviceEntity_Surfaces_SurfaceId",
x => x.SurfaceId,
"Surfaces",
"Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "LayerSettings",
columns: table => new
"LayerSettings",
table => new
{
Guid = table.Column<string>(nullable: false),
Guid = table.Column<string>(),
Name = table.Column<string>(nullable: true),
Value = table.Column<string>(nullable: true),
LayerEntityGuid = table.Column<string>(nullable: true)
@ -142,18 +133,18 @@ namespace Artemis.Storage.Migrations
{
table.PrimaryKey("PK_LayerSettings", x => x.Guid);
table.ForeignKey(
name: "FK_LayerSettings_Layers_LayerEntityGuid",
column: x => x.LayerEntityGuid,
principalTable: "Layers",
principalColumn: "Guid",
"FK_LayerSettings_Layers_LayerEntityGuid",
x => x.LayerEntityGuid,
"Layers",
"Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Leds",
columns: table => new
"Leds",
table => new
{
Guid = table.Column<string>(nullable: false),
Guid = table.Column<string>(),
LedName = table.Column<string>(nullable: true),
LimitedToDevice = table.Column<string>(nullable: true),
LayerId = table.Column<string>(nullable: true)
@ -162,19 +153,19 @@ namespace Artemis.Storage.Migrations
{
table.PrimaryKey("PK_Leds", x => x.Guid);
table.ForeignKey(
name: "FK_Leds_Layers_LayerId",
column: x => x.LayerId,
principalTable: "Layers",
principalColumn: "Guid",
"FK_Leds_Layers_LayerId",
x => x.LayerId,
"Layers",
"Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Keypoints",
columns: table => new
"Keypoints",
table => new
{
Guid = table.Column<string>(nullable: false),
Time = table.Column<int>(nullable: false),
Guid = table.Column<string>(),
Time = table.Column<int>(),
Value = table.Column<string>(nullable: true),
LayerSettingEntityGuid = table.Column<string>(nullable: true)
},
@ -182,80 +173,80 @@ namespace Artemis.Storage.Migrations
{
table.PrimaryKey("PK_Keypoints", x => x.Guid);
table.ForeignKey(
name: "FK_Keypoints_LayerSettings_LayerSettingEntityGuid",
column: x => x.LayerSettingEntityGuid,
principalTable: "LayerSettings",
principalColumn: "Guid",
"FK_Keypoints_LayerSettings_LayerSettingEntityGuid",
x => x.LayerSettingEntityGuid,
"LayerSettings",
"Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_DeviceEntity_SurfaceId",
table: "DeviceEntity",
column: "SurfaceId");
"IX_DeviceEntity_SurfaceId",
"DeviceEntity",
"SurfaceId");
migrationBuilder.CreateIndex(
name: "IX_Folders_FolderEntityGuid",
table: "Folders",
column: "FolderEntityGuid");
"IX_Folders_FolderEntityGuid",
"Folders",
"FolderEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_Keypoints_LayerSettingEntityGuid",
table: "Keypoints",
column: "LayerSettingEntityGuid");
"IX_Keypoints_LayerSettingEntityGuid",
"Keypoints",
"LayerSettingEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_Layers_FolderEntityGuid",
table: "Layers",
column: "FolderEntityGuid");
"IX_Layers_FolderEntityGuid",
"Layers",
"FolderEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_LayerSettings_LayerEntityGuid",
table: "LayerSettings",
column: "LayerEntityGuid");
"IX_LayerSettings_LayerEntityGuid",
"LayerSettings",
"LayerEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_Leds_LayerId",
table: "Leds",
column: "LayerId");
"IX_Leds_LayerId",
"Leds",
"LayerId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_RootFolderGuid",
table: "Profiles",
column: "RootFolderGuid");
"IX_Profiles_RootFolderGuid",
"Profiles",
"RootFolderGuid");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DeviceEntity");
"DeviceEntity");
migrationBuilder.DropTable(
name: "Keypoints");
"Keypoints");
migrationBuilder.DropTable(
name: "Leds");
"Leds");
migrationBuilder.DropTable(
name: "PluginSettings");
"PluginSettings");
migrationBuilder.DropTable(
name: "Profiles");
"Profiles");
migrationBuilder.DropTable(
name: "Settings");
"Settings");
migrationBuilder.DropTable(
name: "Surfaces");
"Surfaces");
migrationBuilder.DropTable(
name: "LayerSettings");
"LayerSettings");
migrationBuilder.DropTable(
name: "Layers");
"Layers");
migrationBuilder.DropTable(
name: "Folders");
"Folders");
}
}
}
}

View File

@ -1,14 +1,13 @@
// <auto-generated />
using System;
using Artemis.Storage;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Artemis.Storage.Migrations
{
[DbContext(typeof(StorageContext))]
partial class StorageContextModelSnapshot : ModelSnapshot
internal class StorageContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
@ -17,227 +16,227 @@ namespace Artemis.Storage.Migrations
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062");
modelBuilder.Entity("Artemis.Storage.Entities.DeviceEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int>("DeviceHashCode");
b.Property<int>("DeviceHashCode");
b.Property<double>("Rotation");
b.Property<double>("Rotation");
b.Property<string>("SurfaceId");
b.Property<string>("SurfaceId");
b.Property<double>("X");
b.Property<double>("X");
b.Property<double>("Y");
b.Property<double>("Y");
b.Property<int>("ZIndex");
b.Property<int>("ZIndex");
b.HasKey("Guid");
b.HasKey("Guid");
b.HasIndex("SurfaceId");
b.HasIndex("SurfaceId");
b.ToTable("DeviceEntity");
});
b.ToTable("DeviceEntity");
});
modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("FolderEntityGuid");
b.Property<string>("FolderEntityGuid");
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<int>("Order");
b.Property<int>("Order");
b.HasKey("Guid");
b.HasKey("Guid");
b.HasIndex("FolderEntityGuid");
b.HasIndex("FolderEntityGuid");
b.ToTable("Folders");
});
b.ToTable("Folders");
});
modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("LayerSettingEntityGuid");
b.Property<string>("LayerSettingEntityGuid");
b.Property<int>("Time");
b.Property<int>("Time");
b.Property<string>("Value");
b.Property<string>("Value");
b.HasKey("Guid");
b.HasKey("Guid");
b.HasIndex("LayerSettingEntityGuid");
b.HasIndex("LayerSettingEntityGuid");
b.ToTable("Keypoints");
});
b.ToTable("Keypoints");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("FolderEntityGuid");
b.Property<string>("FolderEntityGuid");
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<int>("Order");
b.Property<int>("Order");
b.HasKey("Guid");
b.HasKey("Guid");
b.HasIndex("FolderEntityGuid");
b.HasIndex("FolderEntityGuid");
b.ToTable("Layers");
});
b.ToTable("Layers");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("LayerEntityGuid");
b.Property<string>("LayerEntityGuid");
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<string>("Value");
b.Property<string>("Value");
b.HasKey("Guid");
b.HasKey("Guid");
b.HasIndex("LayerEntityGuid");
b.HasIndex("LayerEntityGuid");
b.ToTable("LayerSettings");
});
b.ToTable("LayerSettings");
});
modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("LayerId");
b.Property<string>("LayerId");
b.Property<string>("LedName");
b.Property<string>("LedName");
b.Property<string>("LimitedToDevice");
b.Property<string>("LimitedToDevice");
b.HasKey("Guid");
b.HasKey("Guid");
b.HasIndex("LayerId");
b.HasIndex("LayerId");
b.ToTable("Leds");
});
b.ToTable("Leds");
});
modelBuilder.Entity("Artemis.Storage.Entities.PluginSettingEntity", b =>
{
b.Property<string>("Name");
{
b.Property<string>("Name");
b.Property<Guid>("PluginGuid");
b.Property<Guid>("PluginGuid");
b.Property<string>("Value");
b.Property<string>("Value");
b.HasKey("Name", "PluginGuid");
b.HasKey("Name", "PluginGuid");
b.ToTable("PluginSettings");
});
b.ToTable("PluginSettings");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<Guid>("PluginGuid");
b.Property<Guid>("PluginGuid");
b.Property<string>("RootFolderGuid");
b.Property<string>("RootFolderGuid");
b.Property<int>("RootFolderId");
b.Property<int>("RootFolderId");
b.HasKey("Guid");
b.HasKey("Guid");
b.HasIndex("RootFolderGuid");
b.HasIndex("RootFolderGuid");
b.ToTable("Profiles");
});
b.ToTable("Profiles");
});
modelBuilder.Entity("Artemis.Storage.Entities.SettingEntity", b =>
{
b.Property<string>("Name")
.ValueGeneratedOnAdd();
{
b.Property<string>("Name")
.ValueGeneratedOnAdd();
b.Property<string>("Value");
b.Property<string>("Value");
b.HasKey("Name");
b.HasKey("Name");
b.ToTable("Settings");
});
b.ToTable("Settings");
});
modelBuilder.Entity("Artemis.Storage.Entities.SurfaceEntity", b =>
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<bool>("IsActive");
b.Property<bool>("IsActive");
b.Property<string>("Name");
b.Property<string>("Name");
b.HasKey("Guid");
b.HasKey("Guid");
b.ToTable("Surfaces");
});
b.ToTable("Surfaces");
});
modelBuilder.Entity("Artemis.Storage.Entities.DeviceEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.SurfaceEntity", "Surface")
.WithMany("DeviceEntities")
.HasForeignKey("SurfaceId");
});
{
b.HasOne("Artemis.Storage.Entities.SurfaceEntity", "Surface")
.WithMany("DeviceEntities")
.HasForeignKey("SurfaceId");
});
modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Folders")
.HasForeignKey("FolderEntityGuid");
});
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Folders")
.HasForeignKey("FolderEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerSettingEntity")
.WithMany("Keypoints")
.HasForeignKey("LayerSettingEntityGuid");
});
{
b.HasOne("Artemis.Storage.Entities.LayerSettingEntity")
.WithMany("Keypoints")
.HasForeignKey("LayerSettingEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Layers")
.HasForeignKey("FolderEntityGuid");
});
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Layers")
.HasForeignKey("FolderEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerEntity")
.WithMany("Settings")
.HasForeignKey("LayerEntityGuid");
});
{
b.HasOne("Artemis.Storage.Entities.LayerEntity")
.WithMany("Settings")
.HasForeignKey("LayerEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer")
.WithMany("Leds")
.HasForeignKey("LayerId");
});
{
b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer")
.WithMany("Leds")
.HasForeignKey("LayerId");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder")
.WithMany()
.HasForeignKey("RootFolderGuid");
});
{
b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder")
.WithMany()
.HasForeignKey("RootFolderGuid");
});
#pragma warning restore 612, 618
}
}
}
}

View File

@ -46,7 +46,7 @@ namespace Artemis.Storage.Repositories
{
return await _dbContext.Surfaces.Include(s => s.DeviceEntities).ToListAsync();
}
public void Save()
{
_dbContext.SaveChanges();

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
@ -30,7 +31,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</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.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
@ -54,7 +56,8 @@
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</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-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
@ -70,7 +73,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.6.0.0" newVersion="2.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
@ -86,7 +90,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
@ -94,7 +99,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly>
<dependentAssembly>
@ -107,4 +113,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>

View File

@ -7,12 +7,6 @@ namespace Artemis.UI.Converters
{
public class NullToVisibilityConverter : IValueConverter
{
private enum Parameters
{
Normal,
Inverted
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var direction = (Parameters) Enum.Parse(typeof(Parameters), (string) parameter ?? throw new InvalidOperationException());
@ -22,6 +16,7 @@ namespace Artemis.UI.Converters
return Visibility.Hidden;
return Visibility.Visible;
}
if (value == null)
return Visibility.Visible;
return Visibility.Hidden;
@ -31,5 +26,11 @@ namespace Artemis.UI.Converters
{
throw new NotImplementedException();
}
private enum Parameters
{
Normal,
Inverted
}
}
}

View File

@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
using Color = System.Windows.Media.Color;
namespace Artemis.UI.Extensions

View File

@ -1,17 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RGB.NET.Core;
using System.Drawing;
namespace Artemis.UI.Extensions
{
public static class RgbRectangleExtensions
{
public static System.Drawing.Rectangle ToDrawingRectangle(this Rectangle rectangle)
public static Rectangle ToDrawingRectangle(this RGB.NET.Core.Rectangle rectangle)
{
return new System.Drawing.Rectangle((int) rectangle.X, (int) rectangle.Y, (int) rectangle.Width, (int) rectangle.Height);
return new Rectangle((int) rectangle.X, (int) rectangle.Y, (int) rectangle.Width, (int) rectangle.Height);
}
}
}

View File

@ -37,7 +37,7 @@ namespace Artemis.UI.Ninject
// Bind the module VM
Bind<IModuleViewModelFactory>().ToFactory();
Bind<IProfileEditorViewModelFactory>().ToFactory();
// Bind all UI services as singletons
Kernel.Bind(x =>
{

View File

@ -1,5 +1,5 @@
using System.Resources;
using System.Reflection;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
using System.Windows;
@ -52,5 +52,4 @@ using System.Windows;
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: NeutralResourcesLanguage("en-US")]

View File

@ -26,10 +26,10 @@ namespace Artemis.UI.Services
new ConstructorArgument("header", header),
new ConstructorArgument("text", text),
new ConstructorArgument("confirmText", confirmText),
new ConstructorArgument("cancelText", cancelText),
new ConstructorArgument("cancelText", cancelText)
};
var result = await ShowDialog<ConfirmDialogViewModel>(arguments);
return (bool)result;
return (bool) result;
}
public async Task<bool> ShowConfirmDialogAt(string identifier, string header, string text, string confirmText = "Confirm", string cancelText = "Cancel")
@ -39,7 +39,7 @@ namespace Artemis.UI.Services
new ConstructorArgument("header", header),
new ConstructorArgument("text", text),
new ConstructorArgument("confirmText", confirmText),
new ConstructorArgument("cancelText", cancelText),
new ConstructorArgument("cancelText", cancelText)
};
var result = await ShowDialogAt<ConfirmDialogViewModel>(identifier, arguments);
return (bool) result;

View File

@ -1,7 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Timers;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
@ -9,7 +8,6 @@ using Artemis.Core.Events;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.Services.Storage;
using Artemis.UI.ViewModels.Screens;
using Artemis.UI.ViewModels.Utilities;
@ -21,7 +19,7 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
{
public class ProfileEditorViewModel : ModuleViewModel
{
private TimerUpdateTrigger _updateTrigger;
private readonly TimerUpdateTrigger _updateTrigger;
public ProfileEditorViewModel(Module module, ISurfaceService surfaceService, ISettingsService settingsService) : base(module, "Profile Editor")
{
@ -37,7 +35,7 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
// Borrow RGB.NET's update trigger, update up to 25 FPS, ignore higher settings than that
var targetFps = Math.Min(settingsService.GetSetting("TargetFrameRate", 25).Value, 25);
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / targetFps };
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / targetFps};
_updateTrigger.Update += UpdateLeds;
_updateTrigger.Start();

View File

@ -11,6 +11,13 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
ApplyLedToViewModel();
}
public Led Led { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
public void ApplyLedToViewModel()
{
X = Led.LedRectangle.X;
@ -18,12 +25,5 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
Width = Led.LedRectangle.Width;
Height = Led.LedRectangle.Height;
}
public Led Led { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
}
}

View File

@ -29,6 +29,8 @@ namespace Artemis.UI.ViewModels.Screens
public ImageSource CurrentFrame { get; set; }
public double CurrentFps { get; set; }
public string Title => "Debugger";
public void ForceGarbageCollection()
{
GC.Collect();
@ -42,10 +44,7 @@ namespace Artemis.UI.ViewModels.Screens
var imageSource = ImageSourceFromBitmap(e.Bitmap);
imageSource.Freeze();
Execute.OnUIThread(() =>
{
CurrentFrame = imageSource;
});
Execute.OnUIThread(() => { CurrentFrame = imageSource; });
}
private void CoreServiceOnFrameRendering(object sender, FrameRenderingEventArgs e)
@ -72,12 +71,10 @@ namespace Artemis.UI.ViewModels.Screens
{
DeleteObject(handle);
}
}
}
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteObject([In] IntPtr hObject);
public string Title => "Debugger";
}
}

View File

@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using Artemis.Core.Events;
@ -16,8 +15,8 @@ namespace Artemis.UI.ViewModels.Screens
public class RootViewModel : Conductor<IScreen>.Collection.OneActive
{
private readonly ICollection<IScreenViewModel> _artemisViewModels;
private readonly IPluginService _pluginService;
private readonly IModuleViewModelFactory _moduleViewModelFactory;
private readonly IPluginService _pluginService;
public RootViewModel(ICollection<IScreenViewModel> artemisViewModels, IPluginService pluginService, IModuleViewModelFactory moduleViewModelFactory)
{

View File

@ -12,6 +12,7 @@ namespace Artemis.UI.ViewModels.Utilities
{
_viewManager = viewManager;
}
public DialogViewModelBase ActiveDialogViewModel { get; set; }
public bool IsOpen { get; set; }

View File

@ -59,7 +59,7 @@ namespace Artemis.UI.ViewModels.Utilities
PanX = Math.Min(0, PanX - delta.Value.X);
PanY = Math.Min(0, PanY - delta.Value.Y);
_lastPanPosition = position;
}

View File

@ -12,9 +12,12 @@
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
@ -26,7 +29,8 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Grid.Row="0" Height="140" Width="196" Fill="{DynamicResource MaterialDesignPaper}" />
<Image Grid.Row="0" Source="{Binding Device.RgbDevice.DeviceInfo.Image}" Height="130" Width="190" RenderOptions.BitmapScalingMode="HighQuality" />
<Image Grid.Row="0" Source="{Binding Device.RgbDevice.DeviceInfo.Image}" Height="130" Width="190"
RenderOptions.BitmapScalingMode="HighQuality" />
<Button Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
HorizontalAlignment="Right"

View File

@ -15,7 +15,7 @@
MouseLeave="{s:Action MouseLeave}"
ToolTip="{Binding Device.RgbDevice.DeviceInfo.DeviceName}">
<UserControl.Resources>
<converters:NullToImageConverter x:Key="NullToImageConverter"/>
<converters:NullToImageConverter x:Key="NullToImageConverter" />
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
</UserControl.Resources>
<Grid>
@ -64,29 +64,40 @@
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Style.Triggers>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.Hover}">
<DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.Hover}">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="ToSelected" />
<BeginStoryboard x:Name="ToHover">
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
<ColorAnimation Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)"
To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.Selected}">
<DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.Selected}">
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="ToHover" />
<BeginStoryboard x:Name="ToSelected">
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" To="{StaticResource Primary400}" Duration="0:0:0.25" />
<ColorAnimation Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" To="{StaticResource Primary400}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
To="{StaticResource Primary400}" Duration="0:0:0.25" />
<ColorAnimation
Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)"
To="{StaticResource Primary400}" Duration="0:0:0.25" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.None}">
<DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.None}">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>

View File

@ -1,19 +1,21 @@
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:surfaceEditor="clr-namespace:Artemis.UI.ViewModels.Controls.SurfaceEditor"
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Views.Controls.SurfaceEditor.SurfaceLedView"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceLedViewModel}}"
d:DesignHeight="25" d:DesignWidth="25">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:surfaceEditor="clr-namespace:Artemis.UI.ViewModels.Controls.SurfaceEditor"
xmlns:Converters="clr-namespace:Artemis.UI.Converters"
x:Class="Artemis.UI.Views.Controls.SurfaceEditor.SurfaceLedView"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceLedViewModel}}"
d:DesignHeight="25" d:DesignWidth="25">
<UserControl.Resources>
<Converters:NullToImageConverter x:Key="NullToImageConverter"/>
<Converters:NullToImageConverter x:Key="NullToImageConverter" />
</UserControl.Resources>
<Grid Width="{Binding Width}" Height="{Binding Height}">
<Grid.Background>
<ImageBrush AlignmentX="Center" AlignmentY="Center" Stretch="Fill" ImageSource="{Binding Led.Image, Converter={StaticResource NullToImageConverter}}" />
<ImageBrush AlignmentX="Center" AlignmentY="Center" Stretch="Fill"
ImageSource="{Binding Led.Image, Converter={StaticResource NullToImageConverter}}" />
</Grid.Background>
</Grid>
</UserControl>

View File

@ -1,22 +1,25 @@
<UserControl x:Class="Artemis.UI.Views.Dialogs.ConfirmDialogView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.Views.Dialogs"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:dialogs="clr-namespace:Artemis.UI.ViewModels.Dialogs"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="163.274" d:DesignWidth="254.425"
d:DataContext="{d:DesignInstance dialogs:ConfirmDialogViewModel}">
<StackPanel Margin="16">
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" Text="{Binding Header}" TextWrapping="Wrap"/>
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 20 0 20" Text="{Binding Text}" TextWrapping="Wrap"/>
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" Text="{Binding Header}" TextWrapping="Wrap" />
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 20 0 20" Text="{Binding Text}"
TextWrapping="Wrap" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}" Content="{Binding CancelText}"/>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0" Command="{s:Action Confirm}" Content="{Binding ConfirmText}"/>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
Command="{s:Action Cancel}" Content="{Binding CancelText}" />
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0"
Command="{s:Action Confirm}" Content="{Binding ConfirmText}" />
</StackPanel>
</StackPanel>
</UserControl>

View File

@ -1,22 +1,24 @@
<UserControl x:Class="Artemis.UI.Views.Dialogs.SurfaceCreateView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.Views.Dialogs"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="213.053" d:DesignWidth="254.425">
<StackPanel Margin="16">
<TextBlock>
Add a new surface layout
</TextBlock>
<TextBox materialDesign:HintAssist.Hint="Layout name" Margin="0 8 0 16" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding SurfaceName}"/>
<TextBox materialDesign:HintAssist.Hint="Layout name" Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding SurfaceName}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
Command="{s:Action Cancel}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
False
@ -24,7 +26,8 @@
</Button.CommandParameter>
CANCEL
</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{s:Action Accept}">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0"
Command="{s:Action Accept}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
True
@ -34,4 +37,4 @@
</Button>
</StackPanel>
</StackPanel>
</UserControl>
</UserControl>

View File

@ -73,9 +73,9 @@
<Grid Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0">
This image shows what is being rendered and dispatched to RGB.NET
@ -83,14 +83,15 @@
<TextBlock Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,5,0" FontWeight="Bold">
FPS:
</TextBlock>
<TextBlock Grid.Column="2" HorizontalAlignment="Right" Text="{Binding CurrentFps}"/>
<TextBlock Grid.Column="2" HorizontalAlignment="Right" Text="{Binding CurrentFps}" />
</Grid>
<materialDesign:Card VerticalAlignment="Stretch" Margin="0, 5,0,0">
<Image Source="{Binding CurrentFrame}" />
</materialDesign:Card>
<Button Command="{s:Action ForceGarbageCollection}" Style="{StaticResource MaterialDesignRaisedButton}" HorizontalAlignment="Left" Margin="0, 10, 0, 0">
<Button Command="{s:Action ForceGarbageCollection}" Style="{StaticResource MaterialDesignRaisedButton}"
HorizontalAlignment="Left" Margin="0, 10, 0, 0">
Force garbage collection
</Button>
</StackPanel>

View File

@ -10,7 +10,8 @@
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance screens:ModuleRootViewModel}">
<dragablz:TabablzControl Margin="0 -1 0 0" FixedHeaderCount="{Binding FixedHeaderCount}" ItemsSource="{Binding ModuleViewModels}">
<dragablz:TabablzControl Margin="0 -1 0 0" FixedHeaderCount="{Binding FixedHeaderCount}"
ItemsSource="{Binding ModuleViewModels}">
<dragablz:TabablzControl.HeaderItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />

View File

@ -33,26 +33,27 @@
</Grid.ColumnDefinitions>
<TextBlock VerticalAlignment="Bottom" Grid.Row="0" Grid.Column="0">Render scale</TextBlock>
<Slider Minimum="0.10"
Maximum="1"
TickFrequency="0.05"
Grid.Row="1"
Grid.Column="0"
Style="{StaticResource MaterialDesignDiscreteSlider}"
<Slider Minimum="0.10"
Maximum="1"
TickFrequency="0.05"
Grid.Row="1"
Grid.Column="0"
Style="{StaticResource MaterialDesignDiscreteSlider}"
ToolTip="MaterialDesignDiscreteSlider"
Value="{Binding RenderScale}" />
<TextBlock VerticalAlignment="Bottom" Grid.Row="0" Grid.Column="1">Target framerate</TextBlock>
<Slider Minimum="5"
Maximum="60"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource MaterialDesignDiscreteSlider}"
<Slider Minimum="5"
Maximum="60"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource MaterialDesignDiscreteSlider}"
ToolTip="MaterialDesignDiscreteSlider"
Value="{Binding TargetFrameRate}" />
</Grid>
<Button Command="{s:Action ShowDebugger}" Style="{StaticResource MaterialDesignRaisedButton}" HorizontalAlignment="Left" Margin="0, 10, 0, 0">
<Button Command="{s:Action ShowDebugger}" Style="{StaticResource MaterialDesignRaisedButton}"
HorizontalAlignment="Left" Margin="0, 10, 0, 0">
Show debugger
</Button>
</StackPanel>
@ -69,7 +70,8 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl xaml:View.Model="{Binding}" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Top" />
<ContentControl xaml:View.Model="{Binding}" Margin="5" HorizontalAlignment="Left"
VerticalAlignment="Top" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

View File

@ -25,7 +25,10 @@
<RowDefinition />
</Grid.RowDefinitions>
<Image Source="{StaticResource BowIcon}" Stretch="Uniform" Margin="6,50,6,6" />
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="White" FontSize="16">Artemis is initializing...</TextBlock>
<TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="White"
FontSize="16">
Artemis is initializing...
</TextBlock>
<TextBlock Grid.Row="2" HorizontalAlignment="Center" Foreground="#FFDDDDDD" Text="{Binding Status}" />
<ProgressBar Grid.Row="3" IsIndeterminate="True" Maximum="1" Minimum="1" Margin="16 0" />
</Grid>

View File

@ -176,37 +176,41 @@
</Grid>
</materialDesign:Card>
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch" Margin="5,0,0,0">
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True" UseLayoutRounding="True">
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1"
VerticalAlignment="Stretch" Margin="5,0,0,0">
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True"
UseLayoutRounding="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListBox Grid.Row="0" ItemsSource="{Binding SurfaceConfigurations}" SelectedItem="{Binding SelectedSurface}">
<ListBox Grid.Row="0" ItemsSource="{Binding SurfaceConfigurations}"
SelectedItem="{Binding SelectedSurface}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type models:Surface}">
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="230"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="230" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<Button Grid.Column="1"
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}"
HorizontalAlignment="Left" VerticalAlignment="Center" />
<Button Grid.Column="1"
Command="{s:Action DeleteSurfaceConfiguration}"
CommandParameter="{Binding}"
Style="{StaticResource MaterialDesignIconForegroundButton}"
ToolTip="Delete layout configuration"
HorizontalAlignment="Right" >
Style="{StaticResource MaterialDesignIconForegroundButton}"
ToolTip="Delete layout configuration"
HorizontalAlignment="Right">
<materialDesign:PackIcon Kind="Trashcan" />
</Button>
</Grid>
</DataTemplate>
</ListBox.Resources>
</ListBox>
<Button Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingActionButton}"
<Button Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingActionButton}"
Command="{s:Action AddSurfaceConfiguration}"
Margin="0 0 10 10"
HorizontalAlignment="Right"

View File

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