예제 #1
0
        public IDirectory OpenDirectory(string path, OpenDirectoryMode mode)
        {
            path = PathTools.Normalize(path);

            var dirs = new List <IDirectory>();

            foreach (IFileSystem fs in Sources)
            {
                DirectoryEntryType type = fs.GetEntryType(path);

                if (type == DirectoryEntryType.File && dirs.Count == 0)
                {
                    ThrowHelper.ThrowResult(ResultFs.PathNotFound);
                }

                if (fs.GetEntryType(path) == DirectoryEntryType.Directory)
                {
                    dirs.Add(fs.OpenDirectory(path, mode));
                }
            }

            var dir = new LayeredFileSystemDirectory(this, dirs, path, mode);

            return(dir);
        }
예제 #2
0
        public IDirectory OpenDirectory(string path, OpenDirectoryMode mode)
        {
            path = PathTools.Normalize(path);

            var dirs = new List <IDirectory>();

            foreach (IFileSystem fs in Sources)
            {
                if (fs.DirectoryExists(path))
                {
                    dirs.Add(fs.OpenDirectory(path, mode));
                }
            }

            var dir = new LayeredFileSystemDirectory(this, dirs, path, mode);

            return(dir);
        }