private void ArchiveExport(object sender, EventArgs e) { var selected = GetSelectedNodes <ArchiveHiearchy>(); if (selected.Count == 0) { return; } List <ArchiveFileInfo> archiveFiles = new List <ArchiveFileInfo>(); foreach (var file in selected) { archiveFiles.Add(file.ArchiveFileInfo); } Console.WriteLine($"selected {selected.Count}"); if (archiveFiles.Count == 1) { SaveFileDialog sfd = new SaveFileDialog(); string name = System.IO.Path.GetFileName(archiveFiles[0].FileName); sfd.FileName = name; sfd.DefaultExt = System.IO.Path.GetExtension(name); if (sfd.ShowDialog() == DialogResult.OK) { Task.Run(() => FileWriteAsync(archiveFiles[0], sfd.FileName)); } } else { FolderSelectDialog ofd = new FolderSelectDialog(); if (ofd.ShowDialog() == DialogResult.OK) { ProgressWindow.Start(() => ExtractFiles(ofd.SelectedPath, archiveFiles), MainForm.Instance); } } }
private void ProgressFinished() { ProgressWindow.CloseProgressBar(); }
public static void HideProgressBar() { ProgressWindow.CloseProgressBar(); }
public static void SetProgressBar(string text, int amount, bool continuous = false) { ProgressWindow.Update(text, amount, continuous); }