2014-12-26 22:51:04 +08:00
|
|
|
|
|
|
|
|
|
namespace Wox.Core.Plugin.QueryDispatcher
|
|
|
|
|
{
|
|
|
|
|
internal static class QueryDispatcher
|
|
|
|
|
{
|
2015-01-26 17:46:55 +08:00
|
|
|
|
private static readonly IQueryDispatcher UserPluginDispatcher = new UserPluginQueryDispatcher();
|
|
|
|
|
private static readonly IQueryDispatcher SystemPluginDispatcher = new SystemPluginQueryDispatcher();
|
2014-12-26 22:51:04 +08:00
|
|
|
|
|
|
|
|
|
public static void Dispatch(Wox.Plugin.Query query)
|
|
|
|
|
{
|
2015-01-26 17:46:55 +08:00
|
|
|
|
if (PluginManager.IsUserPluginQuery(query))
|
2014-12-26 22:51:04 +08:00
|
|
|
|
{
|
2015-01-26 17:46:55 +08:00
|
|
|
|
query.Search = query.RawQuery.Substring(query.RawQuery.IndexOf(' ') + 1);
|
|
|
|
|
UserPluginDispatcher.Dispatch(query);
|
2014-12-26 22:51:04 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-01-26 17:46:55 +08:00
|
|
|
|
query.Search = query.RawQuery;
|
|
|
|
|
SystemPluginDispatcher.Dispatch(query);
|
2014-12-26 22:51:04 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|