1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-02 10:43:31 +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

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

View File

@ -1,6 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using RGB.NET.Core;
namespace Artemis.Core.Models.Profile.Interfaces 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.Plugins.Models;
using Artemis.Core.Services.Interfaces; using Artemis.Core.Services.Interfaces;
using Artemis.Storage.Entities; using Artemis.Storage.Entities;
using RGB.NET.Core;
namespace Artemis.Core.Models.Profile namespace Artemis.Core.Models.Profile
{ {

View File

@ -1,13 +1,11 @@
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Linq; using System.Linq;
using Artemis.Core.Extensions; using Artemis.Core.Extensions;
using Artemis.Core.Plugins.Abstract; using Artemis.Core.Plugins.Abstract;
using Artemis.Storage.Entities; using Artemis.Storage.Entities;
using RGB.NET.Core; using RGB.NET.Core;
using Point = RGB.NET.Core.Point;
using Rectangle = System.Drawing.Rectangle; using Rectangle = System.Drawing.Rectangle;
namespace Artemis.Core.Models.Surface namespace Artemis.Core.Models.Surface

View File

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

View File

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

View File

@ -19,7 +19,6 @@ namespace Artemis.Core.Ninject
if (requestingType != null) if (requestingType != null)
return _logger.ForContext(requestingType); return _logger.ForContext(requestingType);
return _logger; return _logger;
} }
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Threading.Tasks;
using Artemis.Core.Plugins.Models; using Artemis.Core.Plugins.Models;
namespace Artemis.Core.Plugins.Abstract namespace Artemis.Core.Plugins.Abstract
@ -17,6 +16,12 @@ namespace Artemis.Core.Plugins.Abstract
public PluginInfo PluginInfo { get; internal set; } 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> /// <summary>
/// Called when the plugin is activated /// Called when the plugin is activated
/// </summary> /// </summary>
@ -26,11 +31,5 @@ namespace Artemis.Core.Plugins.Abstract
/// Called when the plugin is deactivated /// Called when the plugin is deactivated
/// </summary> /// </summary>
public abstract void DisablePlugin(); 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.Profile;
using Artemis.Core.Models.Surface; using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Models; using Artemis.Core.Plugins.Models;
using RGB.NET.Core;
namespace Artemis.Core.Plugins.Abstract namespace Artemis.Core.Plugins.Abstract
{ {

View File

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

View File

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

View File

@ -1,5 +1,4 @@
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.Exceptions; using Artemis.Core.Exceptions;
@ -101,6 +100,16 @@ namespace Artemis.Core.Services
OnFrameRendered(new FrameRenderedEventArgs(_rgbService.GraphicsDecorator.GetBitmap(), _rgbService.Surface)); 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 #region Events
public event EventHandler Initialized; public event EventHandler Initialized;
@ -114,15 +123,5 @@ namespace Artemis.Core.Services
} }
#endregion #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.Models;
using Artemis.Core.Plugins.Abstract; using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Interfaces;
namespace Artemis.Core.Services.Interfaces namespace Artemis.Core.Services.Interfaces
{ {

View File

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

View File

@ -63,9 +63,7 @@ namespace Artemis.Core.Services
// Find the matching plugin in the plugin folder // Find the matching plugin in the plugin folder
var match = pluginDirectory.EnumerateDirectories().FirstOrDefault(d => d.Name == subDirectory.Name); var match = pluginDirectory.EnumerateDirectories().FirstOrDefault(d => d.Name == subDirectory.Name);
if (match == null) if (match == null)
{
CopyBuiltInPlugin(subDirectory); CopyBuiltInPlugin(subDirectory);
}
else else
{ {
var metadataFile = Path.Combine(match.FullName, "plugin.json"); var metadataFile = Path.Combine(match.FullName, "plugin.json");
@ -76,6 +74,7 @@ namespace Artemis.Core.Services
CopyBuiltInPlugin(subDirectory); CopyBuiltInPlugin(subDirectory);
} }
else else
{
try try
{ {
// Compare versions, copy if the same when debugging // Compare versions, copy if the same when debugging
@ -103,6 +102,7 @@ namespace Artemis.Core.Services
} }
} }
} }
}
/// <inheritdoc /> /// <inheritdoc />
public void LoadPlugins() public void LoadPlugins()
@ -128,10 +128,7 @@ namespace Artemis.Core.Services
{ {
// Load the metadata // Load the metadata
var metadataFile = Path.Combine(subDirectory.FullName, "plugin.json"); var metadataFile = Path.Combine(subDirectory.FullName, "plugin.json");
if (!File.Exists(metadataFile)) if (!File.Exists(metadataFile)) _logger.Warning(new ArtemisPluginException("Couldn't find the plugins metadata file at " + metadataFile), "Plugin exception");
{
_logger.Warning(new ArtemisPluginException("Couldn't find the plugins metadata file at " + metadataFile), "Plugin exception");
}
// Locate the main entry // Locate the main entry
var pluginInfo = JsonConvert.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile)); var pluginInfo = JsonConvert.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile));

View File

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

View File

@ -17,11 +17,11 @@ namespace Artemis.Core.Services.Storage
public class SurfaceService : ISurfaceService public class SurfaceService : ISurfaceService
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IRgbService _rgbService;
private readonly IPluginService _pluginService; private readonly IPluginService _pluginService;
private readonly PluginSetting<double> _renderScaleSetting;
private readonly IRgbService _rgbService;
private readonly List<Surface> _surfaceConfigurations; private readonly List<Surface> _surfaceConfigurations;
private readonly ISurfaceRepository _surfaceRepository; private readonly ISurfaceRepository _surfaceRepository;
private readonly PluginSetting<double> _renderScaleSetting;
internal SurfaceService(ILogger logger, ISurfaceRepository surfaceRepository, IRgbService rgbService, IPluginService pluginService, ISettingsService settingsService) 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 #region Repository
private void LoadFromRepository() private void LoadFromRepository()
@ -225,6 +204,27 @@ namespace Artemis.Core.Services.Storage
#endregion #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 #region Events
public event EventHandler<SurfaceConfigurationEventArgs> ActiveSurfaceConfigurationChanged; public event EventHandler<SurfaceConfigurationEventArgs> ActiveSurfaceConfigurationChanged;

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">
@ -27,7 +28,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.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.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>
@ -51,7 +53,8 @@
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.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-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -67,7 +70,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="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" /> <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -83,7 +87,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -91,7 +96,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly> </dependentAssembly>
<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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</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="AppDomainToolkit" version="1.0.4.3" targetFramework="net461" /> <package id="AppDomainToolkit" version="1.0.4.3" targetFramework="net461" />
<package id="Ben.Demystifier" version="0.1.4" targetFramework="net472" /> <package id="Ben.Demystifier" version="0.1.4" targetFramework="net472" />

View File

@ -1,5 +1,4 @@
using System.IO; using System.IO;
using Artemis.Core.Extensions;
using Artemis.Core.Plugins.Abstract; using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models; using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces; using Artemis.Core.Services.Interfaces;

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.1.5.0" newVersion="4.1.5.0" /> <bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly> </dependentAssembly>
<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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.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="System.ValueTuple" version="4.5.0" targetFramework="net472" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages> </packages>

View File

@ -1,6 +1,4 @@
using System; using System.IO;
using System.IO;
using Artemis.Core.Extensions;
using Artemis.Core.Plugins.Abstract; using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models; using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces; using Artemis.Core.Services.Interfaces;

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

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

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.1.5.0" newVersion="4.1.5.0" /> <bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly> </dependentAssembly>
<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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -32,4 +34,7 @@
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </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"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="QRCoder" version="1.2.5" targetFramework="net461" /> <package id="QRCoder" version="1.2.5" targetFramework="net461" />
<package id="Stylet" version="1.2.0" targetFramework="net472" /> <package id="Stylet" version="1.2.0" targetFramework="net472" />

View File

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

View File

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

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.1.5.0" newVersion="4.1.5.0" /> <bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly> </dependentAssembly>
<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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -32,4 +34,7 @@
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </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"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="QRCoder" version="1.3.5" targetFramework="net461" /> <package id="QRCoder" version="1.3.5" targetFramework="net461" />
<package id="Stylet" version="1.2.0" targetFramework="net472" /> <package id="Stylet" version="1.2.0" targetFramework="net472" />

View File

@ -1,5 +1,4 @@
using System; using System;
using System.ComponentModel.DataAnnotations;
namespace Artemis.Storage.Entities namespace Artemis.Storage.Entities
{ {

View File

@ -8,11 +8,11 @@ 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
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
Order = table.Column<int>(nullable: false), Order = table.Column<int>(),
Name = table.Column<string>(nullable: true), Name = table.Column<string>(nullable: true),
FolderEntityGuid = 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.PrimaryKey("PK_Folders", x => x.Guid);
table.ForeignKey( table.ForeignKey(
name: "FK_Folders_Folders_FolderEntityGuid", "FK_Folders_Folders_FolderEntityGuid",
column: x => x.FolderEntityGuid, x => x.FolderEntityGuid,
principalTable: "Folders", "Folders",
principalColumn: "Guid", "Guid",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "PluginSettings", "PluginSettings",
columns: table => new table => new
{ {
PluginGuid = table.Column<Guid>(nullable: false), PluginGuid = table.Column<Guid>(),
Name = table.Column<string>(nullable: false), Name = table.Column<string>(),
Value = table.Column<string>(nullable: true) Value = table.Column<string>(nullable: true)
}, },
constraints: table => constraints: table => { table.PrimaryKey("PK_PluginSettings", x => new {x.Name, x.PluginGuid}); });
{
table.PrimaryKey("PK_PluginSettings", x => new { x.Name, x.PluginGuid });
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Settings", "Settings",
columns: table => new table => new
{ {
Name = table.Column<string>(nullable: false), Name = table.Column<string>(),
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: "Surfaces", "Surfaces",
columns: table => new table => new
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
Name = table.Column<string>(nullable: true), Name = table.Column<string>(nullable: true),
IsActive = table.Column<bool>(nullable: false) IsActive = table.Column<bool>()
}, },
constraints: table => constraints: table => { table.PrimaryKey("PK_Surfaces", x => x.Guid); });
{
table.PrimaryKey("PK_Surfaces", x => x.Guid);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Layers", "Layers",
columns: table => new table => new
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
Order = table.Column<int>(nullable: false), Order = table.Column<int>(),
Name = table.Column<string>(nullable: true), Name = table.Column<string>(nullable: true),
FolderEntityGuid = 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.PrimaryKey("PK_Layers", x => x.Guid);
table.ForeignKey( table.ForeignKey(
name: "FK_Layers_Folders_FolderEntityGuid", "FK_Layers_Folders_FolderEntityGuid",
column: x => x.FolderEntityGuid, x => x.FolderEntityGuid,
principalTable: "Folders", "Folders",
principalColumn: "Guid", "Guid",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Profiles", "Profiles",
columns: table => new table => new
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
PluginGuid = table.Column<Guid>(nullable: false), PluginGuid = table.Column<Guid>(),
Name = table.Column<string>(nullable: true), Name = table.Column<string>(nullable: true),
RootFolderId = table.Column<int>(nullable: false), RootFolderId = table.Column<int>(),
RootFolderGuid = table.Column<string>(nullable: true) RootFolderGuid = table.Column<string>(nullable: true)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_Profiles", x => x.Guid); table.PrimaryKey("PK_Profiles", x => x.Guid);
table.ForeignKey( table.ForeignKey(
name: "FK_Profiles_Folders_RootFolderGuid", "FK_Profiles_Folders_RootFolderGuid",
column: x => x.RootFolderGuid, x => x.RootFolderGuid,
principalTable: "Folders", "Folders",
principalColumn: "Guid", "Guid",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "DeviceEntity", "DeviceEntity",
columns: table => new table => new
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
DeviceHashCode = table.Column<int>(nullable: false), DeviceHashCode = table.Column<int>(),
X = table.Column<double>(nullable: false), X = table.Column<double>(),
Y = table.Column<double>(nullable: false), Y = table.Column<double>(),
Rotation = table.Column<double>(nullable: false), Rotation = table.Column<double>(),
ZIndex = table.Column<int>(nullable: false), ZIndex = table.Column<int>(),
SurfaceId = table.Column<string>(nullable: true) SurfaceId = table.Column<string>(nullable: true)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_DeviceEntity", x => x.Guid); table.PrimaryKey("PK_DeviceEntity", x => x.Guid);
table.ForeignKey( table.ForeignKey(
name: "FK_DeviceEntity_Surfaces_SurfaceId", "FK_DeviceEntity_Surfaces_SurfaceId",
column: x => x.SurfaceId, x => x.SurfaceId,
principalTable: "Surfaces", "Surfaces",
principalColumn: "Guid", "Guid",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "LayerSettings", "LayerSettings",
columns: table => new table => new
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
Name = table.Column<string>(nullable: true), Name = table.Column<string>(nullable: true),
Value = table.Column<string>(nullable: true), Value = table.Column<string>(nullable: true),
LayerEntityGuid = 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.PrimaryKey("PK_LayerSettings", x => x.Guid);
table.ForeignKey( table.ForeignKey(
name: "FK_LayerSettings_Layers_LayerEntityGuid", "FK_LayerSettings_Layers_LayerEntityGuid",
column: x => x.LayerEntityGuid, x => x.LayerEntityGuid,
principalTable: "Layers", "Layers",
principalColumn: "Guid", "Guid",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Leds", "Leds",
columns: table => new table => new
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
LedName = table.Column<string>(nullable: true), LedName = table.Column<string>(nullable: true),
LimitedToDevice = table.Column<string>(nullable: true), LimitedToDevice = table.Column<string>(nullable: true),
LayerId = 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.PrimaryKey("PK_Leds", x => x.Guid);
table.ForeignKey( table.ForeignKey(
name: "FK_Leds_Layers_LayerId", "FK_Leds_Layers_LayerId",
column: x => x.LayerId, x => x.LayerId,
principalTable: "Layers", "Layers",
principalColumn: "Guid", "Guid",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Keypoints", "Keypoints",
columns: table => new table => new
{ {
Guid = table.Column<string>(nullable: false), Guid = table.Column<string>(),
Time = table.Column<int>(nullable: false), Time = table.Column<int>(),
Value = table.Column<string>(nullable: true), Value = table.Column<string>(nullable: true),
LayerSettingEntityGuid = 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.PrimaryKey("PK_Keypoints", x => x.Guid);
table.ForeignKey( table.ForeignKey(
name: "FK_Keypoints_LayerSettings_LayerSettingEntityGuid", "FK_Keypoints_LayerSettings_LayerSettingEntityGuid",
column: x => x.LayerSettingEntityGuid, x => x.LayerSettingEntityGuid,
principalTable: "LayerSettings", "LayerSettings",
principalColumn: "Guid", "Guid",
onDelete: ReferentialAction.Restrict); onDelete: ReferentialAction.Restrict);
}); });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_DeviceEntity_SurfaceId", "IX_DeviceEntity_SurfaceId",
table: "DeviceEntity", "DeviceEntity",
column: "SurfaceId"); "SurfaceId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Folders_FolderEntityGuid", "IX_Folders_FolderEntityGuid",
table: "Folders", "Folders",
column: "FolderEntityGuid"); "FolderEntityGuid");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Keypoints_LayerSettingEntityGuid", "IX_Keypoints_LayerSettingEntityGuid",
table: "Keypoints", "Keypoints",
column: "LayerSettingEntityGuid"); "LayerSettingEntityGuid");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Layers_FolderEntityGuid", "IX_Layers_FolderEntityGuid",
table: "Layers", "Layers",
column: "FolderEntityGuid"); "FolderEntityGuid");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_LayerSettings_LayerEntityGuid", "IX_LayerSettings_LayerEntityGuid",
table: "LayerSettings", "LayerSettings",
column: "LayerEntityGuid"); "LayerEntityGuid");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Leds_LayerId", "IX_Leds_LayerId",
table: "Leds", "Leds",
column: "LayerId"); "LayerId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Profiles_RootFolderGuid", "IX_Profiles_RootFolderGuid",
table: "Profiles", "Profiles",
column: "RootFolderGuid"); "RootFolderGuid");
} }
protected override void Down(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "DeviceEntity"); "DeviceEntity");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Keypoints"); "Keypoints");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Leds"); "Leds");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "PluginSettings"); "PluginSettings");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Profiles"); "Profiles");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Settings"); "Settings");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Surfaces"); "Surfaces");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "LayerSettings"); "LayerSettings");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Layers"); "Layers");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Folders"); "Folders");
} }
} }
} }

View File

@ -1,14 +1,13 @@
// <auto-generated /> // <auto-generated />
using System; using System;
using Artemis.Storage;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
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

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> <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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.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.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>
@ -54,7 +56,8 @@
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.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-3.0.0.0" newVersion="3.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -70,7 +73,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="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" /> <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -86,7 +90,8 @@
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" /> <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly> </dependentAssembly>
<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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
@ -94,7 +99,8 @@
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" /> <bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly> </dependentAssembly>
<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" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.1" newVersion="4.0.3.1" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>

View File

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

View File

@ -1,17 +1,12 @@
using System; using System.Drawing;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RGB.NET.Core;
namespace Artemis.UI.Extensions namespace Artemis.UI.Extensions
{ {
public static class RgbRectangleExtensions 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

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

View File

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

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Timers;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
@ -9,7 +8,6 @@ using Artemis.Core.Events;
using Artemis.Core.Models.Surface; using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Abstract; using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Services; using Artemis.Core.Services;
using Artemis.Core.Services.Interfaces;
using Artemis.Core.Services.Storage; using Artemis.Core.Services.Storage;
using Artemis.UI.ViewModels.Screens; using Artemis.UI.ViewModels.Screens;
using Artemis.UI.ViewModels.Utilities; using Artemis.UI.ViewModels.Utilities;
@ -21,7 +19,7 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
{ {
public class ProfileEditorViewModel : ModuleViewModel public class ProfileEditorViewModel : ModuleViewModel
{ {
private TimerUpdateTrigger _updateTrigger; private readonly TimerUpdateTrigger _updateTrigger;
public ProfileEditorViewModel(Module module, ISurfaceService surfaceService, ISettingsService settingsService) : base(module, "Profile Editor") public ProfileEditorViewModel(Module module, ISurfaceService surfaceService, ISettingsService settingsService) : base(module, "Profile Editor")
{ {

View File

@ -11,6 +11,13 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
ApplyLedToViewModel(); 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() public void ApplyLedToViewModel()
{ {
X = Led.LedRectangle.X; X = Led.LedRectangle.X;
@ -18,12 +25,5 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
Width = Led.LedRectangle.Width; Width = Led.LedRectangle.Width;
Height = Led.LedRectangle.Height; 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 ImageSource CurrentFrame { get; set; }
public double CurrentFps { get; set; } public double CurrentFps { get; set; }
public string Title => "Debugger";
public void ForceGarbageCollection() public void ForceGarbageCollection()
{ {
GC.Collect(); GC.Collect();
@ -42,10 +44,7 @@ namespace Artemis.UI.ViewModels.Screens
var imageSource = ImageSourceFromBitmap(e.Bitmap); var imageSource = ImageSourceFromBitmap(e.Bitmap);
imageSource.Freeze(); imageSource.Freeze();
Execute.OnUIThread(() => Execute.OnUIThread(() => { CurrentFrame = imageSource; });
{
CurrentFrame = imageSource;
});
} }
private void CoreServiceOnFrameRendering(object sender, FrameRenderingEventArgs e) private void CoreServiceOnFrameRendering(object sender, FrameRenderingEventArgs e)
@ -77,7 +76,5 @@ namespace Artemis.UI.ViewModels.Screens
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")] [DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteObject([In] IntPtr hObject); public static extern bool DeleteObject([In] IntPtr hObject);
public string Title => "Debugger";
} }
} }

View File

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

View File

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

View File

@ -12,9 +12,12 @@
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" /> <ResourceDictionary
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" /> Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.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.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
@ -26,7 +29,8 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Rectangle Grid.Row="0" Height="140" Width="196" Fill="{DynamicResource MaterialDesignPaper}" /> <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" <Button Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingActionMiniButton}" Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
HorizontalAlignment="Right" HorizontalAlignment="Right"

View File

@ -64,29 +64,40 @@
<Rectangle.Style> <Rectangle.Style>
<Style TargetType="{x:Type Rectangle}"> <Style TargetType="{x:Type Rectangle}">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.Hover}"> <DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.Hover}">
<DataTrigger.EnterActions> <DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="ToSelected" /> <StopStoryboard BeginStoryboardName="ToSelected" />
<BeginStoryboard x:Name="ToHover"> <BeginStoryboard x:Name="ToHover">
<Storyboard> <Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" /> <ColorAnimation
<ColorAnimation Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" /> 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> </Storyboard>
</BeginStoryboard> </BeginStoryboard>
</DataTrigger.EnterActions> </DataTrigger.EnterActions>
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.Selected}"> <DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.Selected}">
<DataTrigger.EnterActions> <DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="ToHover" /> <StopStoryboard BeginStoryboardName="ToHover" />
<BeginStoryboard x:Name="ToSelected"> <BeginStoryboard x:Name="ToSelected">
<Storyboard> <Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" To="{StaticResource Primary400}" Duration="0:0:0.25" /> <ColorAnimation
<ColorAnimation Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" To="{StaticResource Primary400}" Duration="0:0:0.25" /> 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> </Storyboard>
</BeginStoryboard> </BeginStoryboard>
</DataTrigger.EnterActions> </DataTrigger.EnterActions>
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding SelectionStatus}" Value="{x:Static surfaceEditor:SelectionStatus.None}"> <DataTrigger Binding="{Binding SelectionStatus}"
Value="{x:Static surfaceEditor:SelectionStatus.None}">
<DataTrigger.EnterActions> <DataTrigger.EnterActions>
<BeginStoryboard> <BeginStoryboard>
<Storyboard> <Storyboard>

View File

@ -4,7 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:surfaceEditor="clr-namespace:Artemis.UI.ViewModels.Controls.SurfaceEditor" xmlns:surfaceEditor="clr-namespace:Artemis.UI.ViewModels.Controls.SurfaceEditor"
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Views.Controls.SurfaceEditor.SurfaceLedView" xmlns:Converters="clr-namespace:Artemis.UI.Converters"
x:Class="Artemis.UI.Views.Controls.SurfaceEditor.SurfaceLedView"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceLedViewModel}}" d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceLedViewModel}}"
d:DesignHeight="25" d:DesignWidth="25"> d:DesignHeight="25" d:DesignWidth="25">
@ -13,7 +14,8 @@
</UserControl.Resources> </UserControl.Resources>
<Grid Width="{Binding Width}" Height="{Binding Height}"> <Grid Width="{Binding Width}" Height="{Binding Height}">
<Grid.Background> <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.Background>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -12,11 +12,14 @@
d:DataContext="{d:DesignInstance dialogs:ConfirmDialogViewModel}"> d:DataContext="{d:DesignInstance dialogs:ConfirmDialogViewModel}">
<StackPanel Margin="16"> <StackPanel Margin="16">
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" Text="{Binding Header}" 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"/> <TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 20 0 20" Text="{Binding Text}"
TextWrapping="Wrap" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <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}" IsCancel="True" Margin="0 8 8 0"
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0" Command="{s:Action Confirm}" Content="{Binding ConfirmText}"/> 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>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@ -13,10 +13,12 @@
Add a new surface layout Add a new surface layout
</TextBlock> </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"> <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> <Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib"> <system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
False False
@ -24,7 +26,8 @@
</Button.CommandParameter> </Button.CommandParameter>
CANCEL CANCEL
</Button> </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> <Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib"> <system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
True True

View File

@ -90,7 +90,8 @@
<Image Source="{Binding CurrentFrame}" /> <Image Source="{Binding CurrentFrame}" />
</materialDesign:Card> </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 Force garbage collection
</Button> </Button>
</StackPanel> </StackPanel>

View File

@ -10,7 +10,8 @@
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
d:DataContext="{d:DesignInstance screens:ModuleRootViewModel}"> 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> <dragablz:TabablzControl.HeaderItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Name}" /> <TextBlock Text="{Binding Name}" />

View File

@ -52,7 +52,8 @@
Value="{Binding TargetFrameRate}" /> Value="{Binding TargetFrameRate}" />
</Grid> </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 Show debugger
</Button> </Button>
</StackPanel> </StackPanel>
@ -69,7 +70,8 @@
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<ContentControl xaml:View.Model="{Binding}" Margin="5" HorizontalAlignment="Left" VerticalAlignment="Top" /> <ContentControl xaml:View.Model="{Binding}" Margin="5" HorizontalAlignment="Left"
VerticalAlignment="Top" />
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>

View File

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

View File

@ -176,14 +176,17 @@
</Grid> </Grid>
</materialDesign:Card> </materialDesign:Card>
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch" Margin="5,0,0,0"> <materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" Grid.Row="2" Grid.Column="1"
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True" UseLayoutRounding="True"> VerticalAlignment="Stretch" Margin="5,0,0,0">
<materialDesign:DialogHost Identifier="SurfaceListDialogHost" CloseOnClickAway="True"
UseLayoutRounding="True">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ListBox Grid.Row="0" ItemsSource="{Binding SurfaceConfigurations}" SelectedItem="{Binding SelectedSurface}"> <ListBox Grid.Row="0" ItemsSource="{Binding SurfaceConfigurations}"
SelectedItem="{Binding SelectedSurface}">
<ListBox.Resources> <ListBox.Resources>
<DataTemplate DataType="{x:Type models:Surface}"> <DataTemplate DataType="{x:Type models:Surface}">
<Grid HorizontalAlignment="Stretch"> <Grid HorizontalAlignment="Stretch">
@ -191,7 +194,8 @@
<ColumnDefinition Width="230" /> <ColumnDefinition Width="230" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" ToolTip="{Binding Name}" HorizontalAlignment="Left" VerticalAlignment="Center"/> <TextBlock Text="{Binding Name}" ToolTip="{Binding Name}"
HorizontalAlignment="Left" VerticalAlignment="Center" />
<Button Grid.Column="1" <Button Grid.Column="1"
Command="{s:Action DeleteSurfaceConfiguration}" Command="{s:Action DeleteSurfaceConfiguration}"
CommandParameter="{Binding}" CommandParameter="{Binding}"

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.4.0" targetFramework="net461" /> <package id="Castle.Core" version="4.4.0" targetFramework="net461" />
<package id="ControlzEx" version="3.0.2.4" targetFramework="net472" /> <package id="ControlzEx" version="3.0.2.4" targetFramework="net472" />