private void OnFilterChecked(object sender, RoutedEventArgs e) { LogEntriesFiltered.Clear(); foreach (LoggingEvent log in LogEntries) { AddFilteredEntry(log); } }
public void AddFilteredEntry(LoggingEvent logEvent) { if (this.Dispatcher != null && !this.Dispatcher.CheckAccess()) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new AddLogHandler((_logEvent) => { AddFilteredEntry(_logEvent); }), logEvent); return; } if (IsApplicable(logEvent) == true) { LogEntriesFiltered.Add(logEvent); } }
private void LogAppender_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { switch (e.Action) { case System.Collections.Specialized.NotifyCollectionChangedAction.Add: e.NewItems.Cast <LoggingEvent>().ToList().ForEach(x => AddEntry(x)); break; case System.Collections.Specialized.NotifyCollectionChangedAction.Reset: LogEntries.Clear(); LogEntriesFiltered.Clear(); App.PrintHeader(); break; } }