2014-01-26 21:18:01 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2014-01-29 18:33:24 +08:00
|
|
|
|
using Wox.Helper;
|
|
|
|
|
using Wox.Plugin;
|
2014-01-26 21:18:01 +08:00
|
|
|
|
|
2014-01-29 18:33:24 +08:00
|
|
|
|
namespace Wox.Commands
|
2014-01-26 21:18:01 +08:00
|
|
|
|
{
|
|
|
|
|
internal static class CommandFactory
|
|
|
|
|
{
|
|
|
|
|
private static PluginCommand pluginCmd;
|
|
|
|
|
private static SystemCommand systemCmd;
|
|
|
|
|
|
|
|
|
|
public static void DispatchCommand(Query query, bool updateView = true)
|
|
|
|
|
{
|
|
|
|
|
//lazy init command instance.
|
|
|
|
|
if (pluginCmd == null)
|
|
|
|
|
{
|
|
|
|
|
pluginCmd = new PluginCommand();
|
|
|
|
|
}
|
|
|
|
|
if (systemCmd == null)
|
|
|
|
|
{
|
|
|
|
|
systemCmd = new SystemCommand();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
systemCmd.Dispatch(query,updateView);
|
|
|
|
|
pluginCmd.Dispatch(query,updateView);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|