EnumeratePaths() public abstract method

public abstract EnumeratePaths ( string fullPath, string searchPattern, SearchOption searchOption, SearchTarget searchTarget ) : IEnumerable
fullPath string
searchPattern string
searchOption SearchOption
searchTarget SearchTarget
return IEnumerable
Esempio n. 1
0
        private static IEnumerable <string> EnumerateFileSystemNames(string path, string searchPattern, SearchOption searchOption,
                                                                     bool includeFiles, bool includeDirs)
        {
            Debug.Assert(path != null);
            Debug.Assert(searchPattern != null);
            Debug.Assert(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly);

            return(FileSystem.EnumeratePaths(path, searchPattern, searchOption,
                                             (includeFiles ? SearchTarget.Files : 0) | (includeDirs ? SearchTarget.Directories : 0)));
        }
Esempio n. 2
0
        // Returns fully qualified user path of dirs/files that matches the search parameters.
        // For recursive search this method will search through all the sub dirs  and execute
        // the given search criteria against every dir.
        // For all the dirs/files returned, it will then demand path discovery permission for
        // their parent folders (it will avoid duplicate permission checks)
        internal static string[] InternalGetFileDirectoryNames(string path, string userPathOriginal, string searchPattern, bool includeFiles, bool includeDirs, SearchOption searchOption)
        {
            Debug.Assert(path != null);
            Debug.Assert(userPathOriginal != null);
            Debug.Assert(searchPattern != null);
            Debug.Assert(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly);

            IEnumerable <string> enumerable = FileSystem.EnumeratePaths(path, searchPattern, searchOption,
                                                                        (includeFiles ? SearchTarget.Files : 0) | (includeDirs ? SearchTarget.Directories : 0));

            return(EnumerableHelpers.ToArray(enumerable));
        }