private void AddReaderWithFileNameCheck(string path) { if (!FileMask.IsMatch(Path.GetFileName(path))) { return; } lock (_readers) { if (!_readers.ContainsKey(path)) { ILogReader reader = _logReaderFactory.CreateReader(path, new FileInfo(path).Length, Encoding); reader.LineReaded += EvaluateEvents; reader.BeginRead(); _readers.Add(path, reader); } } }