Esempio n. 1
0
        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());
            }
        }
Esempio n. 2
0
 private void InternalOnLogAppended(object sender, LogChangedEventArgs logChangedEventArgs)
 {
     lock (_lock)
     {
         Filter();
     }
     LogAppended?.Invoke(this, logChangedEventArgs);
 }
Esempio n. 3
0
 private void AppendLog(string msg = null)
 {
     if (!string.IsNullOrEmpty(msg))
     {
         _logBuilder.AppendLine(msg);
     }
     MainWindowVM.DispatcherInvoke(() =>
     {
         Log = _logBuilder.ToString();
         LogAppended?.Invoke(this, EventArgs.Empty);
     });
 }
Esempio n. 4
0
 override protected void Append(LoggingEvent loggingEvent)
 {
     LogAppended?.Invoke(this, new ViewEventArgs("log4net",
                                                 RenderLoggingEvent(loggingEvent)));
 }
Esempio n. 5
0
 private void InternalOnLogAppended(object sender, LogChangedEventArgs logChangedEventArgs)
 {
     LogAppended?.Invoke(this, logChangedEventArgs);
 }
Esempio n. 6
0
 public static void Log(string log)
 {
     System.Diagnostics.Debug.WriteLine(log); Status = log; LogAppended?.Invoke(log);
 }