Exemple #1
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);
        }
Exemple #2
0
 public static FileName GetFileName(string name)
 {
     return(GetFileName(PathName.GetPathName(name)));
 }