using System.Collections.Generic; using Wox.Plugin; namespace Wox.Infrastructure.UserSettings { public class PluginsSettings : BaseModel { public string PythonDirectory { get; set; } public Dictionary Plugins { get; set; } = new Dictionary(); public void UpdatePluginSettings(List metadatas) { foreach (var metadata in metadatas) { if (Plugins.ContainsKey(metadata.ID)) { var settings = Plugins[metadata.ID]; if (settings.ActionKeywords?.Count > 0) { metadata.ActionKeywords = settings.ActionKeywords; metadata.ActionKeyword = settings.ActionKeywords[0]; } metadata.Disabled = settings.Disabled; } else { Plugins[metadata.ID] = new Plugin { ID = metadata.ID, Name = metadata.Name, ActionKeywords = metadata.ActionKeywords, Disabled = metadata.Disabled }; } } } } public class Plugin { public string ID { get; set; } public string Name { get; set; } public List ActionKeywords { get; set; } public bool Disabled { get; set; } } }