using System; using System.IO; using System.Reflection; using Artemis.Core.Plugins.Abstract; using Artemis.Storage.Entities.Plugins; using McMaster.NETCore.Plugins; 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; } /// /// A short description of the plugin /// public string Description { get; set; } /// /// The plugins display icon that's shown in the settings see for /// available /// icons /// public string Icon { get; 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 PluginLoader backing this plugin /// [JsonIgnore] internal PluginLoader PluginLoader { get; set; } /// /// The assembly the plugin code lives in /// [JsonIgnore] internal Assembly Assembly { get; set; } /// /// The entity representing the plugin /// [JsonIgnore] internal PluginEntity PluginEntity { get; set; } public override string ToString() { return $"{nameof(Guid)}: {Guid}, {nameof(Name)}: {Name}, {nameof(Version)}: {Version}"; } } }