Exemple #1
0
        public static Dir ToDir(this VirtualDir dir)
        {
            if (dir == null)
            {
                throw new IOException("does not exist");
            }
            var path = dir.GetPath();
            var fs   = dir.Files.Select(x => Path.Combine(path, x.Key));
            var ds   = dir.Directories.Select(x => Path.Combine(path, x.Key));

            return(Dir.Create(path, ds, fs));
        }
Exemple #2
0
 internal string GetPath()
 {
     if (Parent != null)
     {
         if (Parent.Parent == null)
         {
             return(Name + Path.DirectorySeparatorChar);
         }
         return(Path.Combine(Parent.GetPath(), Name));
     }
     return("");
 }