Esempio n. 1
0
 public static void LogEvent(string eventDescription, object sender, ImportanceLevels importnceLevel)
 {
     if (LogRegisterd != null)
     {
         var logEventArgs = new LogRegisteredEventArgs()
         {
             EventDescription = eventDescription,
             Sender           = sender,
             ImportanceLevels = importnceLevel
         };
         foreach (EventHandler <LogRegisteredEventArgs> method in LogRegisterd.GetInvocationList())
         {
             try
             {
                 method.Invoke(sender, logEventArgs);
             }
             catch
             {
                 // Don't fail on log error.
             }
         }
     }
 }
Esempio n. 2
0
 public static void LogEvent(string eventDescription, object sender, ImportanceLevels importnceLevel)
 {
     if (LogRegisterd != null)
     {
         var logEventArgs = new LogRegisteredEventArgs()
                                      {
                                          EventDescription = eventDescription,
                                          Sender = sender,
                                          ImportanceLevels = importnceLevel
                                      };
         foreach (EventHandler<LogRegisteredEventArgs> method in LogRegisterd.GetInvocationList())
         {
             try
             {
                 method.Invoke(sender, logEventArgs);
             }
             catch 
             {
                 // Don't fail on log error.
             }
         }
     }
 }