예제 #1
0
        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();
 }
예제 #3
0
 public static void HideProgressBar()
 {
     ProgressWindow.CloseProgressBar();
 }
예제 #4
0
 public static void SetProgressBar(string text, int amount, bool continuous = false)
 {
     ProgressWindow.Update(text, amount, continuous);
 }