コード例 #1
0
        Directory GetRootDirectory(PathName name)
        {
            string root = Path.GetPathRoot(name.GetAbsolutePath());

            var di = new DirectoryInfo(root);

            return new DotNetDirectory(DirectoryName.GetDirectoryName(di.FullName));
        }
コード例 #2
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);
        }