PowerToys/Wox/Commands/CommandFactory.cs
2014-03-18 23:41:34 +08:00

32 lines
724 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wox.Helper;
using Wox.Plugin;
namespace Wox.Commands
{
internal static class CommandFactory
{
private static PluginCommand pluginCmd;
private static SystemCommand systemCmd;
public static void DispatchCommand(Query query)
{
//lazy init command instance.
if (pluginCmd == null)
{
pluginCmd = new PluginCommand();
}
if (systemCmd == null)
{
systemCmd = new SystemCommand();
}
systemCmd.Dispatch(query);
pluginCmd.Dispatch(query);
}
}
}