using System; using System.Collections.Generic; using System.Linq; using System.Text; using QM.Exchange.Custom.Commands.Samples; using QM.Exchange.Interface; namespace QM.Exchange.Core.ProcessProgram { /// /// 处理程序工厂 /// public class CommandFactory { /// /// 创建程序执行者 /// /// 程序执行者 public CommandExecutor CreateExecutor(CommonMessage message) { CommandExecutor executor = new CommandExecutor(); //添加处理程序 switch(message.MsgType) { case "RemoteShutLight"://远程关灯 executor.SetCommand(new RShutLightCommand(message)); break; case "Broadcast": executor.SetCommand(new BroadcastCommand(message)); break; } return executor; } } }