private void ZipToolStripMenuItem_Click(object sender, EventArgs e) { var archivePath = Path.Combine(curDir.ToString(), "archive"); var collection = directoryView.SelectedIndices; CreateUniqueDirectory(ref archivePath); for (int i = 0; i < collection.Count; i++) { var file = fileList[collection[i]]; file.Path = Path.Combine(curDir.ToString(), file.Name); if (file.IsFolder) { var newPath = Path.Combine(archivePath, file.Name); CreateUniqueDirectory(ref newPath); CopyDirectory(file.Path, newPath); } else { File.Copy(file.Path, Path.Combine(archivePath, file.Name), true); } } string folderPath = archivePath; CreateUniqueZip(ref archivePath); Directory.Delete(folderPath, true); var newNameForm = new RenameForm(archivePath); newNameForm.Show(); RefreshButton_Click(sender, e); }
private void RenameToolStripMenuItem_Click(object sender, EventArgs e) { Form rename = new RenameForm(Path.Combine(curDir.ToString(), fileList[directoryView.SelectedIndices[0]].Name)); rename.Show(); }