PowerToys/Wox.Core/Plugin/QueryDispatcher/QueryDispatcher.cs
2015-01-26 17:46:55 +08:00

24 lines
775 B
C#

namespace Wox.Core.Plugin.QueryDispatcher
{
internal static class QueryDispatcher
{
private static readonly IQueryDispatcher UserPluginDispatcher = new UserPluginQueryDispatcher();
private static readonly IQueryDispatcher SystemPluginDispatcher = new SystemPluginQueryDispatcher();
public static void Dispatch(Wox.Plugin.Query query)
{
if (PluginManager.IsUserPluginQuery(query))
{
query.Search = query.RawQuery.Substring(query.RawQuery.IndexOf(' ') + 1);
UserPluginDispatcher.Dispatch(query);
}
else
{
query.Search = query.RawQuery;
SystemPluginDispatcher.Dispatch(query);
}
}
}
}