コード例 #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);
                }
            }
        }
コード例 #2
0
 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);
 }