Пример #1
0
 public IEnumerable<string> Scan(params string[] pathes)
 {
     var scanTargetDirs = removeSubpathes(pathes);
     PathCollection filePathCollection = new PathCollection();
     foreach (string targetDir in scanTargetDirs)
     {
         filePathCollection.AddRange(Directory.GetFiles(targetDir, _pattern, SearchOption.AllDirectories));
     }
     return filePathCollection;
 }
Пример #2
0
 internal PathCollection RemoveSubPathes()
 {
     PathCollection result = new PathCollection();
     result.AddRange(_pathList);
     result.Sort();
     for (int i = 1; i < result.Count(); )
     {
         if (result[i].StartsWith(result[i - 1]))
         {
             result.Remove(result[i]);
             continue;
         }
         i++;
     }
     return result;
 }
Пример #3
0
 private PathCollection removeSubpathes(params string[] pathes)
 {
     PathCollection collection = new PathCollection();
     collection.AddRange(pathes);
     return collection.RemoveSubPathes();
 }