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; }
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; }
private PathCollection removeSubpathes(params string[] pathes) { PathCollection collection = new PathCollection(); collection.AddRange(pathes); return collection.RemoveSubPathes(); }