\r
public override string Name {\r
get {\r
- return Path.GetFileName (FullPath);\r
+ string result = Path.GetFileName (FullPath);\r
+ if (result == null || result == "")
+ return FullPath;
+ return result;
}\r
}\r
\r
public DirectoryInfo Parent {\r
get {\r
- return new DirectoryInfo (Path.GetDirectoryName (FullPath));\r
+ string dirname = Path.GetDirectoryName (FullPath);
+ if (dirname == null)
+ return null;
+
+ return new DirectoryInfo (dirname);
}\r
}\r
\r
public DirectoryInfo Root {\r
get {\r
- return new DirectoryInfo (Path.GetPathRoot (FullPath));\r
+ string root = Path.GetPathRoot (FullPath);
+ if (root == null)
+ return null;
+
+ return new DirectoryInfo (root);
}\r
}\r
\r
}\r
\r
public void MoveTo (string dest) {\r
- Directory.Move (FullPath, dest);\r
+ Directory.Move (FullPath, Path.GetFullPath (dest));
}\r
\r
public override string ToString () {\r
- return OriginalPath;\r
+ return OriginalPath;
}\r
}\r
}\r