public IEnumerable <IDirectory> EnumerateDirectories(string SearchPattern, SearchOption Options = SearchOption.TopDirectoryOnly) { foreach (DirectoryInfo SubDirectory in InternalDirectory.EnumerateDirectories(SearchPattern, Options)) { yield return(new Directory(SubDirectory)); } }
/// <summary> /// Enumerates directories under this directory /// </summary> /// <param name="SearchPattern">Search pattern</param> /// <param name="Options">Search options</param> /// <returns>List of directories under this directory</returns> public override IEnumerable <IDirectory> EnumerateDirectories(string SearchPattern = "*", SearchOption Options = SearchOption.TopDirectoryOnly) { if (InternalDirectory != null) { foreach (System.IO.DirectoryInfo SubDirectory in InternalDirectory.EnumerateDirectories(SearchPattern, Options)) { yield return(new LocalDirectory(SubDirectory)); } } }
/// <summary> /// Enumerates directories under this directory /// </summary> /// <param name="searchPattern">Search pattern</param> /// <param name="options">Search options</param> /// <returns>List of directories under this directory</returns> public override IEnumerable <IDirectory> EnumerateDirectories(string searchPattern = "*", SearchOption options = SearchOption.TopDirectoryOnly) { if (!Exists) { yield break; } foreach (var SubDirectory in InternalDirectory.EnumerateDirectories(searchPattern, options)) { yield return(new LocalDirectory(SubDirectory)); } }