Exemple #1
0
        /// <summary>
        /// Adds an log entry to the log.
        /// </summary>
        /// <param name="entry">The new log entry.</param>
        public void Log(LogEntry entry)
        {
            if (entry.Level == 255 && !LogDebugMessages) {
                return;
            }

            if (_maxLogEntries > 0 && _log.Count >= _maxLogEntries) {
                _log.RemoveAt(0);
            }
            _log.Add(entry);

            if (IsOpen || IsOpening) {
                UpdateView(_autoScroll);
            }

            if (LogEntryAdded != null) {
                LogEntryAdded(this, new LogEventArgs(entry));
            }
        }
Exemple #2
0
 /// <summary>
 /// Creates a new instance of the LogEventArgs.
 /// </summary>
 /// <param name="entry">The log entry.</param>
 public LogEventArgs(LogEntry entry)
 {
     Entry = entry;
 }