Plugins - Added optional configuration window

Plugins - Moved plugins to their own directory
Device providers - Added all RGB.NET device providers
This commit is contained in:
Robert committed 2020-02-27 19:05:35 +01:00
1 parent 13943f86a7
commit 9b62ba5f3d
752 files changed
+2198 -73

No files matched your search

@@ -25,8 +25,6 @@ namespace Artemis.Core.Plugins.Abstract
{
if (sender.GetType().IsGenericType(type))
{
Debug.WriteLine(e.RelativePart);
Debug.WriteLine(e.FileName);
// Start from the plugin directory
if (e.RelativePart != null && e.FileName != null)
e.FinalPath = Path.Combine(PluginInfo.Directory.FullName, e.RelativePart, e.FileName);
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Abstract.ViewModels;
using Artemis.Core.Plugins.Models;
using SkiaSharp;
@@ -1,4 +1,5 @@
using System;
using Artemis.Core.Plugins.Abstract.ViewModels;
using Artemis.Core.Plugins.Models;
namespace Artemis.Core.Plugins.Abstract
@@ -16,6 +17,12 @@ namespace Artemis.Core.Plugins.Abstract
public PluginInfo PluginInfo { get; internal set; }
/// <summary>
/// Gets or sets whether this plugin has a configuration view model.
/// If set to true, <see cref="GetConfigurationViewModel" /> will be called when the plugin is configured from the UI.
/// </summary>
public bool HasConfigurationViewModel { get; protected set; }
/// <inheritdoc />
/// <summary>
/// Called when the plugin is unloaded, clean up any unmanaged resources here
@@ -31,5 +38,15 @@ namespace Artemis.Core.Plugins.Abstract
/// Called when the plugin is deactivated
/// </summary>
public abstract void DisablePlugin();
/// <summary>
/// Called when the plugin's configuration window is opened from the UI. The UI will only attempt to open if
/// <see cref="HasConfigurationViewModel" /> is set to True.
/// </summary>
/// <returns></returns>
public virtual PluginConfigurationViewModel GetConfigurationViewModel()
{
return null;
}
}
}
@@ -1,6 +1,6 @@
using Stylet;
namespace Artemis.Core.Plugins.Abstract
namespace Artemis.Core.Plugins.Abstract.ViewModels
{
public abstract class ModuleViewModel : Screen
{
@@ -0,0 +1,14 @@
using Stylet;
namespace Artemis.Core.Plugins.Abstract.ViewModels
{
public abstract class PluginConfigurationViewModel : Screen
{
protected PluginConfigurationViewModel(Plugin plugin)
{
Plugin = plugin;
}
public Plugin Plugin { get; set; }
}
}
@@ -25,6 +25,11 @@ namespace Artemis.Core.Plugins.Models
[JsonProperty(Required = Required.Always)]
public string Name { get; internal set; }
/// <summary>
/// A short description of the plugin
/// </summary>
public string Description { get; set; }
/// <summary>
/// The version of the plugin
/// </summary>
@@ -62,7 +67,7 @@ namespace Artemis.Core.Plugins.Models
internal PluginLoader PluginLoader { get; set; }
/// <summary>
/// The assembly the plugin code lives in
/// The assembly the plugin code lives in
/// </summary>
[JsonIgnore]
internal Assembly Assembly { get; set; }