Пример #1
0
        public void UnRegisterLog(LogBase objLog)
        {
            lock (SyncObject)
            {
                Logs.Remove(objLog);
                objLog.MessageTypeAdded   -= new MessageTypeAddedEventHandler(Logs_MessageTypeAdded);
                objLog.MessageTypeRemoved -= new MessageTypeRemovedEventHandler(Logs_MessageTypeRemoved);
                objLog.WriteMessageFailed -= new WriteMessageFailedHandler(Logs_WriteMessageFailed);
                objLog.MessageTypeChanged -= new MessageTypePropertyChangedEventHandler(Logs_MessageTypeChanged);
            }

            OnLogSettingsChanged();
        }
Пример #2
0
 private void WriteMessageToLog(MessageBase objMessage, LogBase objLog)
 {
     try
     {
         if ((objLog != null) && (objLog.Enabled == true))
         {
             objLog.WriteMessage(objMessage);
         }
     }
     catch (Exception objException)
     {
         Logs_WriteMessageFailed(objLog, new WriteMessageFailedEventArgs(objMessage, objException));
     }
 }