Esempio n. 1
0
 public void RegisterCommandListener(string command, CommandReceivedHandler onCommand)
 {
     if (!CommandHandlers.ContainsKey(command))
     {
         CommandHandlers.Add(command, new List <CommandReceivedHandler>());
     }
     CommandHandlers[command].Add(onCommand);
 }
Esempio n. 2
0
        //notify subscribers that a command was received
        protected virtual void NotifyCommandReceived(Command args)
        {
            CommandReceivedHandler handler = CommandReceivedSubscribers;

            if (handler != null)
            {
                handler(args);
            }
        }