Пример #1
0
 void ILogger.Log(LogItem item)
 {
     addLogItem(Log, item);
 }
Пример #2
0
 private static void addLogItem(ObservableCollection<LogItem> log, LogItem item)
 {
     // taking unit tests into account (Application.Current is null there)
     if (Application.Current != null && Application.Current.Dispatcher != null)
     {
         Action action = () => log.Add(item);
         Application.Current.Dispatcher.Invoke(action);
     }
     else
     {
         log.Add(item);
     }
 }
Пример #3
0
 public void Log(LogItem item)
 {
     Console.WriteLine(item.Severity + ": " + item.Message);
 }