Exemplo n.º 1
0
        public static void Copy(string source, string dest)
        {
            if (!DirectoryEx.Exists(source))
            {
                throw new IOException("Source not exist.");
            }
            //if (DirectoryEx.Exists(dest))
            //    throw new IOException("Dest already exist.");

            IOTools.Copy(source, dest);

            string[] subFiles = GetFiles(source);
            foreach (string subFile in subFiles)
            {
                IOTools.Copy(subFile, subFile.Replace(source, dest));
            }

            string[] subDirs = GetDirectories(source);
            foreach (string subdir in subDirs)
            {
                Copy(subdir, subdir.Replace(source, dest));
            }
        }
Exemplo n.º 2
0
 public static FileSystemInfoEx FromString(string FullName)
 {
     return(DirectoryEx.Exists(FullName) ? (FileSystemInfoEx) new DirectoryInfoEx(FullName) : new FileInfoEx(FullName));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a subdirectory
 /// </summary>
 /// <param name="path"> directory name.</param>
 public DirectoryInfoEx CreateDirectory(string path)
 {
     checkExists();
     return(DirectoryEx.CreateDirectory(PathEx.Combine(FullName, path)));
 }