Ejemplo n.º 1
0
        private static bool CopyDirectory(string srcDirectory, string dstDirectoryParent, out string dstDirectory)
        {
            dstDirectory = Path.Combine(dstDirectoryParent, Path.GetFileName(srcDirectory));

            if (!Directory.Exists(dstDirectoryParent))
            {
                ErrorReport.NotifyUserOfProblem(new DirectoryNotFoundException(dstDirectoryParent + " not found."),
                                                "{0} was unable to copy the directory {1} to {2}", EntryAssembly.ProductName, srcDirectory, dstDirectoryParent);
                return(false);
            }
            if (DirectoryHelper.AreEquivalent(srcDirectory, dstDirectory))
            {
                ErrorReport.NotifyUserOfProblem(new Exception("Cannot copy directory to itself."),
                                                "{0} was unable to copy the directory {1} to {2}", EntryAssembly.ProductName, srcDirectory, dstDirectoryParent);
                return(false);
            }

            return(CopyDirectoryContents(srcDirectory, dstDirectory));
        }
Ejemplo n.º 2
0
 public static bool AreDirectoriesEquivalent(DirectoryInfo dirInfo1, DirectoryInfo dirInfo2)
 {
     return(DirectoryHelper.AreEquivalent(dirInfo1, dirInfo2));
 }
Ejemplo n.º 3
0
 public static bool AreDirectoriesEquivalent(string dir1, string dir2)
 {
     return(DirectoryHelper.AreEquivalent(dir1, dir2));
 }