private void wizardControl1_Finished(object sender, EventArgs e) { List <string> listy = new List <string>(); string password = null; foreach (object item in listBox1.Items) { if (System.IO.Directory.Exists((string)item) == true) { try { System.IO.DirectoryInfo dd = new System.IO.DirectoryInfo((string)item); foreach (System.IO.FileInfo file in dd.GetFiles("*.*", System.IO.SearchOption.AllDirectories)) { listy.Add(file.FullName); } } catch { } } else { listy.Add((string)item); } } if (checkBox1.Checked == true) { password = txtPassword.Text; } var archiveProcressScreen = new ArchiveProcressScreen(listy, txtOutput.Text, ArchiveAction.Compress, txtName.Text, format, false, password, GetSpeedFromNumber(this.trackBar1.Value)); archiveProcressScreen.Show(); this.Close(); }
private void btn_removefile_Click(object sender, EventArgs e) { var selectedNode = archiveTree.SelectedNode; var fileAndDirectoryNames = new List <string>(); if (selectedNode.Nodes.Count > 0) { foreach (TreeNode node in selectedNode.Nodes) { var childTag = node.Tag; var childArchiveFileInfo = (ArchiveFileInfo)childTag; fileAndDirectoryNames.Add(childArchiveFileInfo.FileName); } } var tag = selectedNode.Tag; var archiveFileInfo = (ArchiveFileInfo)tag; fileAndDirectoryNames.Add(archiveFileInfo.FileName); var archiveProcressScreen = new ArchiveProcressScreen(fileAndDirectoryNames, _pathArchive, ArchiveAction.RemoveFile); archiveProcressScreen.Show(); ShowArchiveContent(null, null); }
private void ExtractToLocation(string archive, string output) { var selectedItems = new List <string>() { archive }; var archiveProcressScreen = new ArchiveProcressScreen(selectedItems, output, ArchiveAction.Extract, ""); archiveProcressScreen.ExtractionCompleted += new ArchiveProcressScreen.ExtractionCompleteEventHandler(ExtractionHasCompleted); archiveProcressScreen.Show(); }
public void Archive(object sender, EventArgs args) { bool compress = rbtn_compress.Checked; if (!compress) { var archiveProcressScreen = new ArchiveProcressScreen(_fileAndDirectoryFullPaths, txt_archivePath.Text, ArchiveAction.Extract, ""); archiveProcressScreen.Show(); } else { //cast the values from the radiobuttons to enums. var format = OutArchiveFormat.Zip; var value = FindSelectedRadiobutton(gb_format); if (string.IsNullOrWhiteSpace(value) == false) { format = (OutArchiveFormat)Enum.Parse(typeof(OutArchiveFormat), value); } var level = CompressionLevel.Normal; var value2 = FindSelectedRadiobutton(gb_compressionlevel); if (string.IsNullOrWhiteSpace(value2) == false) { level = (CompressionLevel)Enum.Parse(typeof(CompressionLevel), value2); } var password = string.IsNullOrWhiteSpace(txt_password.Text) ? null : txt_password.Text; var archiveProcressScreen = new ArchiveProcressScreen(_fileAndDirectoryFullPaths, txt_archivePath.Text, ArchiveAction.Compress, txt_archivename.Text, format, cb_fastCompression.Checked, password, level); archiveProcressScreen.Show(); } Dispose(true); }
private void ExtractToLocation(string archive, string output) { var selectedItems = new List<string>() { archive }; var archiveProcressScreen = new ArchiveProcressScreen(selectedItems, output, ArchiveAction.Extract, ""); archiveProcressScreen.ExtractionCompleted += new ArchiveProcressScreen.ExtractionCompleteEventHandler(ExtractionHasCompleted); AddToLog("Archive Extracted to " + output + " from source " + archive); archiveProcressScreen.Show(); }
public void Archive(object sender, EventArgs args) { bool compress = rbtn_compress.Checked; if (!compress) { var archiveProcressScreen = new ArchiveProcressScreen(_fileAndDirectoryFullPaths, txt_archivePath.Text, ArchiveAction.Extract, ""); archiveProcressScreen.Show(); } else { //cast the values from the radiobuttons to enums. var format = OutArchiveFormat.Zip; var value = FindSelectedRadiobutton(gb_format); if (string.IsNullOrWhiteSpace(value) == false) { format = (OutArchiveFormat)Enum.Parse(typeof(OutArchiveFormat), value); } var level = CompressionLevel.Normal; var value2 = FindSelectedRadiobutton(gb_compressionlevel); if (string.IsNullOrWhiteSpace(value2) == false) { level = (CompressionLevel)Enum.Parse(typeof(CompressionLevel), value2); } var password = string.IsNullOrWhiteSpace(txt_password.Text) ? null : txt_password.Text; var archiveProcressScreen = new ArchiveProcressScreen(_fileAndDirectoryFullPaths, txt_archivePath.Text, ArchiveAction.Compress,txt_archivename.Text, format, cb_fastCompression.Checked, password, level); archiveProcressScreen.Show(); } Dispose(true); }
private void wizardControl1_Finished(object sender, EventArgs e) { List<string> listy = new List<string>(); string password = null; foreach (object item in listBox1.Items) { if (System.IO.Directory.Exists((string)item) == true) { try { System.IO.DirectoryInfo dd = new System.IO.DirectoryInfo((string)item); foreach (System.IO.FileInfo file in dd.GetFiles("*.*", System.IO.SearchOption.AllDirectories)) { listy.Add(file.FullName); } } catch { } } else { listy.Add((string)item); } } if (checkBox1.Checked == true) { password = txtPassword.Text; } var archiveProcressScreen = new ArchiveProcressScreen(listy, txtOutput.Text, ArchiveAction.Compress, txtName.Text, format, false, password, GetSpeedFromNumber(this.trackBar1.Value)); archiveProcressScreen.Show(); this.Close(); }
private void btn_removefile_Click(object sender, EventArgs e) { var selectedNode = archiveTree.SelectedNode; var fileAndDirectoryNames = new List<string>(); if (selectedNode.Nodes.Count > 0) { foreach(TreeNode node in selectedNode.Nodes) { var childTag = node.Tag; var childArchiveFileInfo = (ArchiveFileInfo)childTag; fileAndDirectoryNames.Add(childArchiveFileInfo.FileName); } } var tag = selectedNode.Tag; var archiveFileInfo = (ArchiveFileInfo)tag; fileAndDirectoryNames.Add(archiveFileInfo.FileName); var archiveProcressScreen = new ArchiveProcressScreen(fileAndDirectoryNames, _pathArchive, ArchiveAction.RemoveFile); archiveProcressScreen.Show(); ShowArchiveContent(null,null); }