void FillLines() { bool newLines; lock (_lock) { int lines = _lineStarts.Count; if (_lineStarts.Any()) { _stream.Seek(_lineStarts.Last()); _stream.ReadLine(true); } while (!_stream.EndOfStream) { long start = _stream.Position; _stream.ReadLine(true); long end = _stream.Position; _lineStarts.Add(start); } newLines = _lineStarts.Count != lines; } if (newLines) { LogAppended?.Invoke(this, new LogChangedEventArgs()); } }
private void InternalOnLogAppended(object sender, LogChangedEventArgs logChangedEventArgs) { lock (_lock) { Filter(); } LogAppended?.Invoke(this, logChangedEventArgs); }
private void AppendLog(string msg = null) { if (!string.IsNullOrEmpty(msg)) { _logBuilder.AppendLine(msg); } MainWindowVM.DispatcherInvoke(() => { Log = _logBuilder.ToString(); LogAppended?.Invoke(this, EventArgs.Empty); }); }
override protected void Append(LoggingEvent loggingEvent) { LogAppended?.Invoke(this, new ViewEventArgs("log4net", RenderLoggingEvent(loggingEvent))); }
private void InternalOnLogAppended(object sender, LogChangedEventArgs logChangedEventArgs) { LogAppended?.Invoke(this, logChangedEventArgs); }
public static void Log(string log) { System.Diagnostics.Debug.WriteLine(log); Status = log; LogAppended?.Invoke(log); }