コード例 #1
0
 /// <summary>
 /// Dispatches the message to the appropiate handler for the given message.
 /// </summary>
 /// <param name="e"></param>
 public void DispatchEvent(PsEvent e)
 {
     Delegate handler = _handlers[e.Type.Name];
     if (handler != null)
         handler.DynamicInvoke(new object[] { e });
 }
コード例 #2
0
ファイル: Server.cs プロジェクト: KyleMassacre/PlanetServer
 /// <summary>
 /// Will either send the message or queue it for later delivery.
 /// </summary>
 /// <param name="message"></param>
 private void SendMessage(PsEvent message)
 {
     if (QueueMessages)
         _eventQueue.Enqueue(message);
     else
         _dispatcher.DispatchEvent(message);
 }