Exemple #1
0
 private void X_MessageLogged(object sender, MessageLoggedEventArgs e)
 {
     EventService.NotifySubscribersOnMessageLogged(((MAController)sender).ManagementAgentID, e);
 }
Exemple #2
0
 internal static void NotifySubscribersOnMessageLogged(Guid managementAgentID, MessageLoggedEventArgs e)
 {
     if (EventService.subscribers.ContainsKey(managementAgentID))
     {
         foreach (IEventCallBack i in EventService.subscribers[managementAgentID].ToArray())
         {
             try
             {
                 i.MessageLogged(e);
             }
             catch (Exception ex)
             {
                 logger.Warn(ex, "Error notifying client. Client will be deregistered");
                 EventService.DeregisterCallbackChannel(i);
             }
         }
     }
 }