コード例 #1
0
        /// <summary>
        /// Method to invoke when the ParseCommand command is executed.
        /// </summary>
        private void OnParseCommandExecute()
        {
            _pleaseWaitService.Push();

            _logEntries = new FastObservableCollection<LogEntry>(_logAnalyzerService.Parse(Filter, Document.Text));

            _dispatcherService.BeginInvoke(() =>
            {
                    var top10SlowestMethods = _logEntries.OrderByDescending(log => log.Time).Take(10);
                    var top10MostCommonLines = _logAnalyzerService.Filter(_logEntries, 10, log => log.LogEvent != LogEvent.Error && log.LogEvent != LogEvent.Warning, null, key => key.Time);
                    var top10ErrorsAndWarnings = _logAnalyzerService.Filter(_logEntries, 10, log => log.LogEvent == LogEvent.Error || log.LogEvent == LogEvent.Warning, null, key => key.Time);

                    _pleaseWaitService.Pop();

                    Top10SlowestMethods = new FastObservableCollection<LogEntry>(top10SlowestMethods);
                    Top10MostCommonLines = new FastObservableCollection<LogEntry>(top10MostCommonLines);
                    Top10ErrorsAndWarnings = new FastObservableCollection<LogEntry>(top10ErrorsAndWarnings);
            });
        }