示例#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
        File ResolveFile(PathName name)
        {
            Directory rootDirectory = GetRootDirectory(name);

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

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

            return(ResolveFile(rootDirectory, names));
        }
示例#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);
		}
示例#4
0
		File ResolveFile(PathName name)
		{
			Directory rootDirectory = GetRootDirectory(name);

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

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

			return ResolveFile(rootDirectory, names);
		}
示例#5
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);
        }
示例#6
0
        public static DirectoryName GetDirectoryName(string name)
        {
            PathName directoryName = PathName.GetPathName(name);

            if (directoryName is RelativePathName)
            {
                return(new RelativeDirectoryName(((RelativePathName)directoryName)));
            }

            if (directoryName is AbsolutePathName)
            {
                return(new AbsoluteDirectoryName(((AbsolutePathName)directoryName)));
            }

            throw new InvalidOperationException("Unable to convert path: " + name);
        }
示例#7
0
 public static DirectoryName GetDirectoryName(PathName pathName)
 {
     return(GetDirectoryName(pathName.GetPath()));
 }
示例#8
0
 public abstract DirectoryName Combine(PathName child);
示例#9
0
 public static FileName GetFileName(string name)
 {
     return(GetFileName(PathName.GetPathName(name)));
 }
示例#10
0
		public static DirectoryName GetDirectoryName(PathName pathName)
		{
			return GetDirectoryName(pathName.GetPath());
		}
示例#11
0
		public abstract DirectoryName Combine(PathName child);
示例#12
0
 public abstract PathName Combine(PathName child);
示例#13
0
		Directory GetRootDirectory(PathName name)
		{
			string root = Path.GetPathRoot(name.GetAbsolutePath());

			var di = new DirectoryInfo(root);

			return new DotNetDirectory(DirectoryName.GetDirectoryName(di.FullName));
		}
示例#14
0
		public abstract PathName Combine(PathName child);