Files
Artemis/src/Artemis.Core/Plugins/Models/PluginInfo.cs
T
SpoinkyNL b3f6aef101 Core port - Targeting .NET Core 3.1!
Core port - Updated projects to new project layout
Core port - Changed the way devices are identified to be consistent across different frameworks
Core port - Updated plugin system to no longer use AppDomain but AssemblyLoadContext (through McMaster.NETCore.Plugins)
Core port - Renamed a few events to keep Fody from getting confused
2020-02-22 18:38:32 +01:00

75 lines
2.1 KiB
C#

using System;
using System.IO;
using System.Reflection;
using Artemis.Core.Plugins.Abstract;
using McMaster.NETCore.Plugins;
using Newtonsoft.Json;
namespace Artemis.Core.Plugins.Models
{
public class PluginInfo
{
internal PluginInfo()
{
}
/// <summary>
/// The plugins GUID
/// </summary>
[JsonProperty(Required = Required.Always)]
public Guid Guid { get; internal set; }
/// <summary>
/// The name of the plugin
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Name { get; internal set; }
/// <summary>
/// The version of the plugin
/// </summary>
[JsonProperty(Required = Required.Always)]
public Version Version { get; internal set; }
/// <summary>
/// The main entry DLL, should contain a class implementing Plugin
/// </summary>
[JsonProperty(Required = Required.Always)]
public string Main { get; internal set; }
/// <summary>
/// The plugins root directory
/// </summary>
[JsonIgnore]
public DirectoryInfo Directory { get; internal set; }
/// <summary>
/// A reference to the type implementing Plugin, available after successful load
/// </summary>
[JsonIgnore]
public Plugin Instance { get; internal set; }
/// <summary>
/// Indicates whether the user enabled the plugin or not
/// </summary>
[JsonIgnore]
public bool Enabled { get; internal set; }
/// <summary>
/// The PluginLoader backing this plugin
/// </summary>
[JsonIgnore]
internal PluginLoader PluginLoader { get; set; }
/// <summary>
/// The assembly the plugin code lives in
/// </summary>
[JsonIgnore]
internal Assembly Assembly { get; set; }
public override string ToString()
{
return $"{nameof(Guid)}: {Guid}, {nameof(Name)}: {Name}, {nameof(Version)}: {Version}";
}
}
}