//returns only filenames static public IEnumerable GetItemNamesRecursive(string path, FileFilter filter) { foreach (string i in DirectoryWalker.GetItemNames(path, filter)) { yield return(i); } foreach (string dir in DirectoryWalker.GetDirectories(path)) { if (IsWalkable(dir)) { foreach (string i in GetItemNamesRecursive(dir, filter)) { yield return(i); } } } yield break; }
static public IEnumerable GetFileInfosRecursive(string path) { foreach (FileInfo i in DirectoryWalker.GetFileInfos(path)) { yield return(i); } foreach (string dir in DirectoryWalker.GetDirectories(path)) { if (IsWalkable(dir)) { foreach (FileInfo i in GetFileInfosRecursive(dir)) { yield return(i); } } } yield break; }