Exemplo n.º 1
0
 public static IVirtualPath GetPath(this IVirtualFileSystem fs, IVirtualPath path)
 {
     if (path is IVirtualFile)
     {
         return(fs.GetFile(path.FullPath));
     }
     if (path is IVirtualFolder)
     {
         return(fs.GetFolder(path.FullPath));
     }
     return(null);
 }
Exemplo n.º 2
0
 public static void CopyPathTo(this IVirtualPath path, IVirtualFileSystem dstfs, string newname)
 {
     if (path is IVirtualFile)
     {
         var dstf = dstfs.GetFile(newname);
         ((IVirtualFile)path).CopyFileTo(dstf, CopyFileMode.Copy);
     }
     else
     {
         var dstf = dstfs.GetFolder(newname);
         if (!dstf.Exists())
         {
             dstf.Create();
         }
     }
 }