private void RemoveLogDescriptions(LogDescription logDescription)
 {
     _logger.Info("log descr. Removed!");
     if (LogDescriptions.Contains(logDescription))
     {
         LogDescriptions.Remove(logDescription);
         OnLogDescriptionChangeDetected(new LogDescriptionChangeEventArgs(logDescription, ChangeType.Deleted));
     }
 }
 private void AddLogDescriptions(LogDescription logDescription)
 {
     _logger.Info("log descr. Created!");
     if (!LogDescriptions.Contains(logDescription))
     {
         LogDescriptions.Add(logDescription);
         OnLogDescriptionChangeDetected(new LogDescriptionChangeEventArgs(logDescription, ChangeType.Created));
     }
 }
 public LogReaderBase(Stream stream, Encoding encoding, LogDescription logDescription/*,
                      LogEventEvaluator logEventEvaluator*/)
 {
     _logFileName = "undefined";
     _logFileEncoding = encoding;
     _logDescription = logDescription;
     //LogEventEvaluator = logEventEvaluator;
     _currentPosition = stream.Position;
     CreateWatcher();
 }
 public LogReaderBase(string logFileName, long currentPosition, Encoding encoding, LogDescription logDescription/*,
                      LogEventEvaluator logEventEvaluator*/)
 {
     _logFileName = logFileName;
     _logFileEncoding = encoding;
     _logDescription = logDescription;
     //LogEventEvaluator = logEventEvaluator;
     _currentPosition = currentPosition;
     CreateWatcher();
 }
 public LogWatcher(LogDescription logDescription)
 {
     LogDescription = logDescription;
     Id = logDescription.Id;
     FileMaskRegex = logDescription.FileMask;
     DateTime now = DateTime.Now;
     _timer = new Timer(NewDayHasCome);
     _timer.Change(new DateTime(now.Year, now.Month, now.Day).AddDays(1).AddMinutes(30) - now,
                   TimeSpan.FromDays(1));
     foreach (string logDirectory in logDescription.LogDirectories)
     {
         CreateReadersForCurrentLogs(logDirectory);    
         AddWatcher(logDirectory);
     }
 }
 private void UpdateLogDescriptions(LogDescription logDescription)
 {
     _logger.Info("log descr. Cahnge! Remove and add it back");
     RemoveLogDescriptions(logDescription);
     AddLogDescriptions(logDescription);
 }
 public LogDescriptionChangeEventArgs(LogDescription logDescription, ChangeType changeType)
 {
     LogDescription = logDescription;
 }
 public TextLogReader(string logFileName, long currentPosition, Encoding encoding, LogDescription logDescription/*, LogEventEvaluator logEventEvaluator*/)
     : base(logFileName, currentPosition, encoding, logDescription)
 {
     CreateReader();
 }
 public TextLogReader(string logFileName, Encoding encoding, LogDescription logDescription/*, LogEventEvaluator logEventEvaluator*/)
     : base(logFileName, 0, encoding, logDescription/*, logEventEvaluator*/)
 {
     CreateReader();
 }