private void RemoveReaderWithFileNameCheck(string path)
 {
     if (!FileMask.IsMatch(Path.GetFileName(path)))
     {
         return;
     }
     lock (_readers)
     {
         if (_readers.ContainsKey(path))
         {
             _readers[path].Dispose();
             _readers.Remove(path);
         }
     }
 }
 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);
         }
     }
 }
Beispiel #3
0
            public bool PassesLocalIncludes(string path, MatchReason reason)
            {
                IncludeFiltersRow[] includes = GetIncludeFiltersRows();

                // it must match at least one global include
                foreach (IncludeFiltersRow include in includes)
                {
                    FileMask wildcard = new FileMask(include.Mask);
                    if (wildcard.IsMatch(path))
                    {
                        reason.Set(include.Mask, MatchReason.Status.Included);
                        return true;
                    }
                }

                // didn't match any include
                return false;
            }
Beispiel #4
0
            public bool PassesLocalExcludes(string path, MatchReason reason)
            {
                ExcludeFiltersRow[] excludes = GetExcludeFiltersRows();

                // it must not match any global exclude
                foreach (ExcludeFiltersRow exclude in excludes)
                {
                    FileMask wildcard = new FileMask(exclude.Mask);
                    if (wildcard.IsMatch(path))
                    {
                        reason.Set(exclude.Mask, MatchReason.Status.Excluded);
                        return false;
                    }
                }

                // passed excludes
                return true;
            }
Beispiel #5
0
        public bool PassesGlobalIncludes(string path, MatchReason reason)
        {
            // it must match at least one global include
            foreach (GlobalIncludeFiltersRow row in GlobalIncludeFilters)
            {
                FileMask wildcard = new FileMask(row.Mask);
                if (wildcard.IsMatch(path))
                {
                    reason.Set(row.Mask, MatchReason.Status.Included);
                    return true;
                }
            }

            // didn't match any include
            return false;
        }
Beispiel #6
0
 public bool PassesGlobalExcludes(string path)
 {
     // it must not match any global exclude
     foreach (GlobalExcludeFiltersRow row in GlobalExcludeFilters)
     {
         FileMask wildcard = new FileMask(row.Mask);
         if (wildcard.IsMatch(path))
         {
             return false;
         }
     }
     return true;
 }