Example #1
0
 public override IEnumerable <string> EnumeratePaths(string fullPath, string searchPattern, SearchOption searchOption, SearchTarget searchTarget)
 {
     return(Win32FileSystemEnumerableFactory.CreateFileNameIterator(fullPath, fullPath, searchPattern,
                                                                    (searchTarget & SearchTarget.Files) == SearchTarget.Files,
                                                                    (searchTarget & SearchTarget.Directories) == SearchTarget.Directories,
                                                                    searchOption));
 }
Example #2
0
        public override IEnumerable <FileSystemInfo> EnumerateFileSystemInfos(string fullPath, string searchPattern, SearchOption searchOption, SearchTarget searchTarget)
        {
            switch (searchTarget)
            {
            case SearchTarget.Directories:
                return(Win32FileSystemEnumerableFactory.CreateDirectoryInfoIterator(fullPath, fullPath, searchPattern, searchOption));

            case SearchTarget.Files:
                return(Win32FileSystemEnumerableFactory.CreateFileInfoIterator(fullPath, fullPath, searchPattern, searchOption));

            case SearchTarget.Both:
                return(Win32FileSystemEnumerableFactory.CreateFileSystemInfoIterator(fullPath, fullPath, searchPattern, searchOption));

            default:
                throw new ArgumentException(SR.ArgumentOutOfRange_Enum, "searchTarget");
            }
        }