Ejemplo n.º 1
0
        Directory GetRootDirectory(PathName name)
        {
            string root = Path.GetPathRoot(name.GetAbsolutePath());

            var di = new DirectoryInfo(root);

            return new DotNetDirectory(DirectoryName.GetDirectoryName(di.FullName));
        }
Ejemplo n.º 2
0
        public override PathName Combine(PathName child)
        {
            if (child is AbsolutePathName)
                throw new InvalidOperationException("Cannot combine an absolute path with a zip path");

            if (child is ZipPathName)
                throw new IOException("Cannot combine a zip file path with a zip file path");

            return new ZipPathName(_zipFilePath, Path.Combine(_contentFilePath, child.GetPath()));
        }
Ejemplo n.º 3
0
        public static FileName GetFileName(PathName pathName)
        {
            if (pathName is RelativePathName)
                return new RelativeFileName(((RelativePathName)pathName));

            if (pathName is AbsolutePathName)
                return new AbsoluteFileName(((AbsolutePathName)pathName));

            throw new InvalidOperationException("Unable to convert path: " + pathName);
        }
Ejemplo n.º 4
0
        Directory ResolveDirectory(PathName name)
        {
            Directory rootDirectory = GetRootDirectory(name);

            string relativePath = name.GetAbsolutePath().Substring(rootDirectory.Name.GetPath().Length);

            string[] names = relativePath.Split('\\', '/');

            return ResolveDirectory(rootDirectory, names);
        }
Ejemplo n.º 5
0
 public abstract DirectoryName Combine(PathName child);
Ejemplo n.º 6
0
 public static DirectoryName GetDirectoryName(PathName pathName)
 {
     return GetDirectoryName(pathName.GetPath());
 }
Ejemplo n.º 7
0
 public override DirectoryName Combine(PathName child)
 {
     return base.Combine(child);
 }
Ejemplo n.º 8
0
 public abstract PathName Combine(PathName child);