public static void CopyDirectory(string sourcePath, string targetPath) { try { if (!Directory.Exists(targetPath)) { Directory.CreateDirectory(targetPath); } string fileName; string destFile; string[] files = Directory.GetFiles(sourcePath); foreach (string s in files) { fileName = Path.GetFileName(s); destFile = Path.Combine(targetPath, fileName); File.Copy(s, destFile, true); } RefreshNaviBoxContent(); } catch { CustomDialog.ErrorMessage("Copy unsuccessful.", "Error"); } }
public void ChooseNavigateOrExecute() { CurrentSelection = new FileInfo(CurrentDirectoryPath + NaviBox.SelectedItems[0].Text); if (NavigatorBoxControl.IsItADirectory(CurrentSelection.FullName)) { WillNavigateIntoDirectory(true); currentDirectoryInfo = new DirectoryInfo(CurrentDirectoryPath); ListContent(); } else { currentDirectoryInfo = Directory.GetParent(CurrentDirectoryPath); try { Process.Start(CurrentSelection.FullName); } catch { CustomDialog.ErrorMessage("ERROR: Could not open file.", "Error"); } } }
public static void DecryptFile(string FileName) { File.Decrypt(FileName); CustomDialog.ErrorMessage("File decrypted successfully.", "Notification"); }