using System.Collections.Generic; using System.IO; using System.Text.Json.Serialization; namespace Flow.Launcher.Plugin { /// /// Plugin metadata /// public class PluginMetadata : BaseModel { /// /// Plugin ID. /// public string ID { get; set; } /// /// Plugin name. /// public string Name { get; set; } /// /// Plugin author. /// public string Author { get; set; } /// /// Plugin version. /// public string Version { get; set; } /// /// Plugin language. /// See /// public string Language { get; set; } /// /// Plugin description. /// public string Description { get; set; } /// /// Plugin website. /// public string Website { get; set; } /// /// Whether plugin is disabled. /// public bool Disabled { get; set; } /// /// Whether plugin is disabled in home query. /// public bool HomeDisabled { get; set; } /// /// Plugin execute file path. /// public string ExecuteFilePath { get; private set; } /// /// Plugin execute file name. /// public string ExecuteFileName { get; set; } /// /// Plugin assembly name. /// Only available for .Net plugins. /// [JsonIgnore] public string AssemblyName { get; internal set; } private string _pluginDirectory; /// /// Plugin source directory. /// public string PluginDirectory { get => _pluginDirectory; internal set { _pluginDirectory = value; ExecuteFilePath = Path.Combine(value, ExecuteFileName); IcoPath = Path.Combine(value, IcoPath); } } /// /// The first action keyword of plugin. /// public string ActionKeyword { get; set; } /// /// All action keywords of plugin. /// public List ActionKeywords { get; set; } /// /// Hide plugin keyword setting panel. /// public bool HideActionKeywordPanel { get; set; } /// /// Plugin search delay time in ms. Null means use default search delay time. /// public int? SearchDelayTime { get; set; } = null; /// /// Plugin icon path. /// public string IcoPath { get; set;} /// /// Plugin priority. /// [JsonIgnore] public int Priority { get; set; } /// /// Init time include both plugin load time and init time. /// [JsonIgnore] public long InitTime { get; set; } /// /// Average query time. /// [JsonIgnore] public long AvgQueryTime { get; set; } /// /// Query count. /// [JsonIgnore] public int QueryCount { get; set; } /// /// The path to the plugin settings directory which is not validated. /// It is used to store plugin settings files and data files. /// When plugin is deleted, FL will ask users whether to keep its settings. /// If users do not want to keep, this directory will be deleted. /// public string PluginSettingsDirectoryPath { get; internal set; } /// /// The path to the plugin cache directory which is not validated. /// It is used to store cache files. /// When plugin is deleted, this directory will be deleted as well. /// public string PluginCacheDirectoryPath { get; internal set; } /// /// Convert to string. /// /// public override string ToString() { return Name; } } }