mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Plugins have their own AppDomain now (TODO: dispose on plugin unload)
This commit is contained in:
1 parent
3689db9325
commit
dba48a2b6a
18 files changed
+118
-69
No files matched your search
@@ -18,7 +18,7 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
public abstract bool ExpandsMainDataModel { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void LoadPlugin()
|
||||
public void EnablePlugin()
|
||||
{
|
||||
// Load and activate the last active profile
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ namespace Artemis.Core.Plugins.Interfaces
|
||||
/// <summary>
|
||||
/// Called when the plugin is loaded
|
||||
/// </summary>
|
||||
void LoadPlugin();
|
||||
void EnablePlugin();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppDomainToolkit;
|
||||
using Artemis.Core.Plugins.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -7,11 +7,6 @@ namespace Artemis.Core.Plugins.Models
|
||||
{
|
||||
public class PluginInfo
|
||||
{
|
||||
public PluginInfo()
|
||||
{
|
||||
Instances = new List<IPlugin>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The plugins GUID
|
||||
/// </summary>
|
||||
@@ -39,10 +34,21 @@ namespace Artemis.Core.Plugins.Models
|
||||
public string Folder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A references to the types implementing IPlugin, available after successful load
|
||||
/// A reference to the type implementing IPlugin, available after successful load
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public List<IPlugin> Instances { get; set; }
|
||||
public IPlugin Instance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the user enabled the plugin or not
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The AppDomain context of this plugin
|
||||
/// </summary>
|
||||
internal AppDomainContext<AssemblyTargetLoader, PathBasedAssemblyResolver> Context { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user