コード例 #1
0
        /// <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);
        }
コード例 #2
0
 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);
         }
     });
 }
コード例 #3
0
        /// <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);
                }
            });
        }
コード例 #4
0
ファイル: TraceOutputViewModel.cs プロジェクト: Catel/Catel
 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);
         }
     });
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
        /// <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);
                }
            });
        }