Dev2.PathOperations.Dev2FileSystemProvider.GetDirectoriesForType C# (CSharp) Method

GetDirectoriesForType() private static method

private static GetDirectoriesForType ( string path, string pattern, ReadTypes type ) : IEnumerable
path string
pattern string
type ReadTypes
return IEnumerable
        private static IEnumerable<string> GetDirectoriesForType(string path, string pattern, ReadTypes type)
        {
            if (type == ReadTypes.Files)
            {
                if (string.IsNullOrEmpty(pattern))
                {
                    return Directory.EnumerateFiles(path);
                }
                return Directory.EnumerateFiles(path, pattern);
            }
            if (type == ReadTypes.Folders)
            {
                if (string.IsNullOrEmpty(pattern))
                {
                    return Directory.EnumerateDirectories(path);
                }
                return Directory.EnumerateDirectories(path, pattern);
            }

            if (string.IsNullOrEmpty(pattern))
            {
                return Directory.EnumerateFileSystemEntries(path);
            }
            return Directory.EnumerateFileSystemEntries(path, pattern);
        }