private void LoadPreloadedFiles(List <ObjectTreeNode> nodes)
        {
            ProgressWindow.Start(() =>
            {
                foreach (var node in nodes)
                {
                    ProgressWindow.Update($"Opening {ArchiveFileInfo.FileName}", 0, true);

                    ArchiveFileInfo.FileFormat = ArchiveFileInfo.OpenFile();
                    if (ArchiveFileInfo.FileFormat != null)
                    {
                        var fileNode = ObjectListWrapperLoader.OpenFormat(new ImageList(), ArchiveFileInfo.FileFormat);
                        node.Tag     = ArchiveFileInfo.FileFormat;
                        foreach (var child in fileNode.Children)
                        {
                            AddChild(child);
                        }
                    }
                }

                ProgressWindow.Wait(1000);
                ProgressWindow.Update($"Finished!", 100);
                ProgressWindow.CloseProgressBar();
            });
        }
        private void ExportAll(object sender, EventArgs e)
        {
            FolderSelectDialog ofd = new FolderSelectDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                var archiveFiles = ArchiveFile.Files.ToList();
                ProgressWindow.Start(() => ExtractFiles(ofd.SelectedPath, archiveFiles), MainForm.Instance);
            }
        }
        private void ExportToFileLocAction(object sender, EventArgs args)
        {
            string folder   = ((IFileFormat)ArchiveFile).FileInfo.FolderPath;
            string filePath = Path.Combine(folder, Label);

            Console.WriteLine($"filePath {filePath}");

            ProgressWindow.Start(() =>
            {
                ArchiveFileInfo.FileWrite(filePath);
                ProgressFinished();
            });
            ProgressWindow.Update($"Exporting {Label}", 0, true);
        }
예제 #4
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);
                }
            }
        }