Ejemplo 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(FileSystemEnumerableFactory.CreateFileNameIterator(path, path, searchPattern,
                                                                      includeFiles, includeDirs, searchOption, true));
        }
Ejemplo n.º 2
0
        private static IEnumerable <String> EnumerateFileSystemNames(String path, String searchPattern, SearchOption searchOption,
                                                                     bool includeFiles, bool includeDirs)
        {
            Contract.Requires(path != null);
            Contract.Requires(searchPattern != null);
            Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly);
            Contract.Ensures(Contract.Result <IEnumerable <String> >() != null);

            return(FileSystemEnumerableFactory.CreateFileNameIterator(path, path, searchPattern,
                                                                      includeFiles, includeDirs, searchOption, true));
        }
Ejemplo n.º 3
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, bool checkHost)
        {
            Contract.Requires(path != null);
            Contract.Requires(userPathOriginal != null);
            Contract.Requires(searchPattern != null);
            Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly);

            IEnumerable <String> enble = FileSystemEnumerableFactory.CreateFileNameIterator(
                path, userPathOriginal, searchPattern,
                includeFiles, includeDirs, searchOption, checkHost);
            List <String> fileList = new List <String>(enble);

            return(fileList.ToArray());
        }
Ejemplo n.º 4
0
        internal static string[] InternalGetFileDirectoryNames(string path, string userPathOriginal, string searchPattern, bool includeFiles, bool includeDirs, SearchOption searchOption)
        {
            List <string> list = new List <string>(FileSystemEnumerableFactory.CreateFileNameIterator(path, userPathOriginal, searchPattern, includeFiles, includeDirs, searchOption));

            return(list.ToArray());
        }
Ejemplo n.º 5
0
 private static IEnumerable <string> EnumerateFileSystemNames(string path, string searchPattern, SearchOption searchOption, bool includeFiles, bool includeDirs)
 {
     return(FileSystemEnumerableFactory.CreateFileNameIterator(path, path, searchPattern, includeFiles, includeDirs, searchOption));
 }