You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1008 B
37 lines
1008 B
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
|
|
{
|
|
/// <summary>
|
|
/// 处理程序工厂
|
|
/// </summary>
|
|
public class CommandFactory
|
|
{
|
|
/// <summary>
|
|
/// 创建程序执行者
|
|
/// </summary>
|
|
/// <returns>程序执行者</returns>
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|