Fix PluginIndicator for multiple action keywords

1. Fixup, part of #352
2. Refactoring
This commit is contained in:
bao-qian
2015-11-05 22:47:28 +00:00
parent 99d9d14d3b
commit 178710dabc
4 changed files with 27 additions and 53 deletions

View File

@@ -119,7 +119,7 @@ namespace Wox.Core.Plugin
if (customizedPluginConfig?.ActionKeywords?.Length > 0)
{
metadata.ActionKeywords = customizedPluginConfig.ActionKeywords;
metadata.ActionKeyword = customizedPluginConfig.ActionKeywords[0]; //todo reenable
metadata.ActionKeyword = customizedPluginConfig.ActionKeywords[0];
}
return metadata;

View File

@@ -29,8 +29,8 @@ namespace Wox.Core.Plugin
public static IEnumerable<PluginPair> AllPlugins { get; private set; }
private static List<PluginPair> GlobalPlugins { get; set; }
private static List<PluginPair> NonGlobalPlugins { get; set; }
public static IEnumerable<PluginPair> GlobalPlugins { get; private set; }
public static IEnumerable<PluginPair> NonGlobalPlugins { get; private set; }
private static IEnumerable<PluginPair> InstantQueryPlugins { get; set; }
public static IPublicAPI API { private set; get; }
@@ -104,19 +104,8 @@ namespace Wox.Core.Plugin
{
InstantQueryPlugins = GetPluginsForInterface<IInstantQuery>();
contextMenuPlugins = GetPluginsForInterface<IContextMenu>();
GlobalPlugins = new List<PluginPair>();
NonGlobalPlugins = new List<PluginPair>();
foreach (var plugin in AllPlugins)
{
if (IsGlobalPlugin(plugin.Metadata))
{
GlobalPlugins.Add(plugin);
}
else
{
NonGlobalPlugins.Add(plugin);
}
}
GlobalPlugins = AllPlugins.Where(p => IsGlobalPlugin(p.Metadata));
NonGlobalPlugins = AllPlugins.Where(p => !IsGlobalPlugin(p.Metadata));
});
}