Пример #1
0
        public IEnumerable <DirectoryInfo> EnumerateDirectories()
        {
            if (Common.IsRunningOnMono())
            {
                return(SysDirectoryInfo.EnumerateDirectories().Select(s => new DirectoryInfo(s.FullName)));
            }

            return(Directory.EnumerateFileSystemEntries(FullPath, "*", true, false, System.IO.SearchOption.TopDirectoryOnly).Select(directory => new DirectoryInfo(directory)));
        }
Пример #2
0
        public IEnumerable <DirectoryInfo> EnumerateDirectories(string searchPattern, SearchOption searchOption)
        {
            if (Common.IsRunningOnMono())
            {
                return(SysDirectoryInfo.EnumerateDirectories(searchPattern, searchOption).Select(s => new DirectoryInfo(s.FullName)));
            }

            return(Directory.EnumerateFileSystemEntries(FullPath, searchPattern, true, false, searchOption)
                   .Select(directory => new DirectoryInfo(directory)));
        }