Example #1
0
 public void registerDataListener(int service, int action, DataHandledDelegate handler)
 {
     lock (dataListeners)
     {
         Dictionary<int, DataHandledDelegate> serviceHandlers;
         if (dataListeners.TryGetValue(service, out serviceHandlers))
         {
             serviceHandlers[action] = handler;
         }
         else
         {
             serviceHandlers = new Dictionary<int, DataHandledDelegate>();
             serviceHandlers[action] = handler;
             dataListeners[service] = serviceHandlers;
         }
     }
 }
Example #2
0
 public void registerDataListener(DataMessage forMessage, DataHandledDelegate handler)
 {
     registerDataListener(forMessage.Service, forMessage.Action, handler);
 }