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