/// <summary> /// Determines if the given entry matches the filter tracelevel. /// </summary> /// <param name="traceEntry">The trace entry.</param> /// <returns>true if matches of if filter is 'Off', false if not </returns> private bool EntryMatchesLevel(TraceEntry traceEntry) { if (SelectedTraceLevel == TraceLevel.Off || SelectedTraceLevel == TraceLevel.Verbose) { return(true); } return(traceEntry.TraceLevel <= SelectedTraceLevel); }
private void OnLogMessage(object sender, LogMessageEventArgs e) { _dispatcherService.BeginInvoke(() => { var traceEntries = TraceEntries; if (traceEntries != null) { var traceEntry = new TraceEntry(new LogEntry(e)); TraceEntries.Add(traceEntry); } }); }
/// <summary> /// Writes a line to the output window. /// </summary> /// <param name="message">Message to write.</param> /// <param name="eventType">Type of the event.</param> private void WriteLine(string message, TraceEventType eventType) { _dispatcherService.Invoke(() => { var traceEntry = new TraceEntry(TraceHelper.ConvertTraceEventTypeToTraceLevel(eventType), message); _traceEntries.Add(traceEntry); if (EntryMatchesLevel(traceEntry)) { TraceEntryCollection.Add(traceEntry); } }); }
/// <summary> /// Determines if the given entry matches the filter tracelevel. /// </summary> /// <param name="traceEntry">The trace entry.</param> /// <returns>true if matches of if filter is 'Off', false if not </returns> private bool EntryMatchesLevel(TraceEntry traceEntry) { if (SelectedTraceLevel == TraceLevel.Off || SelectedTraceLevel == TraceLevel.Verbose) { return true; } return (traceEntry.TraceLevel <= SelectedTraceLevel); }