private void ToggleLogEntryBookmark() { LogEntryViewModel selected = lstLog.SelectedItem as LogEntryViewModel; if (selected != null) { selected.Bookmarked = !selected.Bookmarked; } }
private void NotifyIfRequired(LogEntryViewModel logEntry) { bool accepted = filters.All(filter => filter.Accept(logEntry)); if (accepted) { foreach (INotifier notifier in notifiers) { notifier.Notify(logEntry); } } }
void watcher_LogEntryDiscovered(object sender, LogEntryDiscoveredEventArgs e) { Dispatcher.BeginInvoke((Action)(() => { var le = new LogEntryViewModel(e.LogEntry); logEntries.Add(le); if (this.Visibility == System.Windows.Visibility.Visible) { lstLog.ScrollIntoView(le); } NotifyIfRequired(le); } )); }