/// <summary> /// Copy the entrie directory /// </summary> private void DoCpDir(string source, string destination, pluginner.IFSPlugin fsa, pluginner.IFSPlugin fsb) { if (!fsb.DirectoryExists(destination)) { fsb.CreateDirectory(destination); } fsb.CurrentDirectory = destination; foreach (DirItem di in fsa.DirectoryContent) { if (di.TextToShow == "..") { /* don't touch the link to the parent directory */} else if (!di.IsDirectory) { //it is file string s1 = di.URL; //source url FSEntryMetadata md1 = fsa.GetMetadata(s1); string s2 = destination + fsb.DirSeparator + md1.Name; //destination url ReplaceQuestionDialog.ClickedButton Placeholder = ReplaceQuestionDialog.ClickedButton.Cancel; DoCp(fsa, fsb, s1, s2, ref Placeholder, new AsyncCopy()); } else if (di.IsDirectory) { //it is subdirectory DoCpDir(di.URL, destination + fsb.DirSeparator + di.TextToShow, fsa,fsb); } } }
/// <summary> /// Copy the entrie directory /// </summary> private void DoCpDir(string source, string destination, pluginner.IFSPlugin fsa, pluginner.IFSPlugin fsb) { if (!fsb.DirectoryExists(destination)) { fsb.CreateDirectory(destination); } fsb.CurrentDirectory = destination; foreach (DirItem di in fsa.DirectoryContent) { if (di.TextToShow == "..") { /* don't touch the link to the parent directory */} else if (!di.IsDirectory) { //it is file string s1 = di.Path; //source url FSEntryMetadata md1 = fsa.GetMetadata(s1); string s2 = destination + fsb.DirSeparator + md1.Name; //destination url DoCp(fsa, fsb, fsa.GetFile(s1, new double()), s2, new AsyncCopy()); } else if (di.IsDirectory) { //it is subdirectory DoCpDir(di.Path, destination + fsb.DirSeparator + di.TextToShow, fsa,fsb); } } }