public static void HandleDSCommand(DSCommandType commandType) { if (CommandMap.ContainsKey(commandType)) { var handler = CommandMap[commandType]; StateInfo stateObject = new StateInfo(handler); ThreadPool.QueueUserWorkItem(new WaitCallback(HandleCommand), stateObject); } else { Console.WriteLine("Unable to handle command type {0} - no associated handler", commandType); } }
public DSCommandMessage(DSCommandType type, string command) { this.CommandType = (int)type; this.Command = command; }