private void DisplayLog(ProcessWatcherEventArgs e) { DisplayLogInternal(e.Output); if (e.Durations.Count > 0) { DurationsBox.Inlines.Clear(); foreach (var duration in e.Durations) { var run = new Run(duration.Item2); if (duration.Item1) { run.FontWeight = FontWeights.Bold; } DurationsBox.Inlines.Add(run); DurationsBox.Inlines.Add(new LineBreak()); } DurationsBox.IsEnabled = true; } WatchingBox.Content = e.Watching; TotalTimeBox.Content = e.TotalTime; }
private void DispatchLogEvent(object sender, ProcessWatcherEventArgs e) { // Handle cross-threading with Invoke and Action Dispatcher.Invoke(new Action(() => DisplayLog(e))); }