예제 #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
파일: FileName.cs 프로젝트: daffers/Magnum
		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
파일: PathName.cs 프로젝트: daffers/Magnum
		public abstract PathName Combine(PathName child);