mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
make some renames
This commit is contained in:
@@ -3,12 +3,12 @@ namespace Wox.Core.Plugin.QueryDispatcher
|
||||
{
|
||||
internal static class QueryDispatcher
|
||||
{
|
||||
private static IQueryDispatcher pluginCmd = new UserPluginQueryDispatcher();
|
||||
private static IQueryDispatcher systemCmd = new SystemPluginQueryDispatcher();
|
||||
private static IQueryDispatcher pluginCmd = new RegularPluginQueryDispatcher();
|
||||
private static IQueryDispatcher systemCmd = new WildcardPluginQueryDispatcher();
|
||||
|
||||
public static void Dispatch(Wox.Plugin.Query query)
|
||||
{
|
||||
if (PluginManager.IsUserPluginQuery(query))
|
||||
if (PluginManager.IsRegularPluginQuery(query))
|
||||
{
|
||||
pluginCmd.Dispatch(query);
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@ using Wox.Plugin;
|
||||
|
||||
namespace Wox.Core.Plugin.QueryDispatcher
|
||||
{
|
||||
public class UserPluginQueryDispatcher : IQueryDispatcher
|
||||
public class RegularPluginQueryDispatcher : IQueryDispatcher
|
||||
{
|
||||
public void Dispatch(Query query)
|
||||
{
|
||||
PluginPair userPlugin = PluginManager.AllPlugins.FirstOrDefault(o => o.Metadata.ActionKeyword == query.ActionName);
|
||||
if (userPlugin != null && !string.IsNullOrEmpty(userPlugin.Metadata.ActionKeyword))
|
||||
PluginPair regularPlugin = PluginManager.AllPlugins.FirstOrDefault(o => o.Metadata.ActionKeyword == query.ActionName);
|
||||
if (regularPlugin != null && !string.IsNullOrEmpty(regularPlugin.Metadata.ActionKeyword))
|
||||
{
|
||||
var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == userPlugin.Metadata.ID);
|
||||
var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == regularPlugin.Metadata.ID);
|
||||
if (customizedPluginConfig != null && customizedPluginConfig.Disabled)
|
||||
{
|
||||
//need to stop the loading animation
|
||||
@@ -28,12 +28,12 @@ namespace Wox.Core.Plugin.QueryDispatcher
|
||||
{
|
||||
try
|
||||
{
|
||||
List<Result> results = userPlugin.Plugin.Query(query) ?? new List<Result>();
|
||||
PluginManager.API.PushResults(query,userPlugin.Metadata,results);
|
||||
List<Result> results = regularPlugin.Plugin.Query(query) ?? new List<Result>();
|
||||
PluginManager.API.PushResults(query,regularPlugin.Metadata,results);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
throw new WoxPluginException(userPlugin.Metadata.Name, e);
|
||||
throw new WoxPluginException(regularPlugin.Metadata.Name, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -5,13 +5,12 @@ using Wox.Core.Exception;
|
||||
using Wox.Core.UserSettings;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Plugin;
|
||||
//using Wox.Plugin.SystemPlugins;
|
||||
|
||||
namespace Wox.Core.Plugin.QueryDispatcher
|
||||
{
|
||||
public class SystemPluginQueryDispatcher : IQueryDispatcher
|
||||
public class WildcardPluginQueryDispatcher : IQueryDispatcher
|
||||
{
|
||||
private IEnumerable<PluginPair> allSytemPlugins = PluginManager.AllPlugins.Where(o => PluginManager.IsSystemPlugin(o.Metadata));
|
||||
private IEnumerable<PluginPair> allSytemPlugins = PluginManager.AllPlugins.Where(o => PluginManager.IsWildcardPlugin(o.Metadata));
|
||||
|
||||
public void Dispatch(Query query)
|
||||
{
|
||||
Reference in New Issue
Block a user