protected void LogReceived(NLog.Common.AsyncLogEventInfo log) { LogEventViewModel vm = new LogEventViewModel(log.LogEvent); Dispatcher.BeginInvoke(new Action(() => { if (LogEntries.Count >= 50) LogEntries.RemoveAt(0); LogEntries.Add(vm); })); }
protected void LogReceived(NLog.Common.AsyncLogEventInfo log) { var vm = new LogEventViewModel(log.LogEvent); Dispatcher.BeginInvoke(new Action(() => { if (LogEntries.Count >= MaxNumLogs) { LogEntries.RemoveAt(0); } LogEntries.Add(vm); })); }
protected void LogReceived(AsyncLogEventInfo log) { LogEventViewModel vm = new LogEventViewModel(log.LogEvent); Dispatcher.BeginInvoke(new Action(() => { if (MaxRowCount > 0 && LogEntries.Count >= MaxRowCount) { LogEntries.RemoveAt(0); } LogEntries.Add(vm); if (AutoScrollToLast) { ScrollToLast(); } ItemAdded(this, (NLogEvent)log.LogEvent); })); }
protected void LogReceived(NLog.Common.AsyncLogEventInfo log) { LogEventViewModel vm = new LogEventViewModel(log.LogEvent); Dispatcher.BeginInvoke(new Action(() => { if (LogEntries.Count >= _MaxLines) { LogEntries.RemoveAt(0); } LogEntries.Add(vm); int LastCount = logView.Items.Count - 1; if (_LastSelect) { logView.SelectedIndex = LastCount; } if (_AutoScroll) { logView.ScrollIntoView(logView.Items[LastCount]); } })); }
protected void LogReceived(NLog.Common.AsyncLogEventInfo log) { LogEventViewModel vm = new LogEventViewModel(log.LogEvent); Dispatcher.BeginInvoke(new Action(() => { if(LogCount!=0 && LogEntries.Count>=LogCount) LogEntries.RemoveAt(0); LogEntries.Add(vm); UpdateFilteredList(); if (AutoScroll) { logView.ScrollIntoView(vm); } })); }