Пример #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);
        }