Exemplo n.º 1
0
        private void extractFiles(string destinationFolder, bool extractAsRaw)
        {
            ArrayList files       = new ArrayList();
            ArrayList directories = new ArrayList();

            if (this.isTreeSelected &&
                this.IsoFolderTreeView.SelectedNode.Tag != null &&
                this.IsoFolderTreeView.SelectedNode.Tag is IDirectoryStructure)
            {
                directories.Add(this.IsoFolderTreeView.SelectedNode.Tag);
            }
            else if (!this.isTreeSelected)
            {
                foreach (ListViewItem lvi in this.fileListView.SelectedItems)
                {
                    if (lvi.Tag != null)
                    {
                        if (lvi.Tag is IFileStructure)
                        {
                            files.Add(lvi.Tag);
                        }
                        else if (lvi.Tag is IDirectoryStructure)
                        {
                            directories.Add(lvi.Tag);
                        }
                    }
                }
            }

            IsoExtractorWorker.IsoExtractorStruct taskStruct =
                new IsoExtractorWorker.IsoExtractorStruct();
            taskStruct.SourcePaths       = new string[] { this.sourceFile };
            taskStruct.DestinationFolder = destinationFolder;
            taskStruct.ExtractAsRaw      = extractAsRaw;
            taskStruct.Files             = (IFileStructure[])files.ToArray(typeof(IFileStructure));
            taskStruct.Directories       = (IDirectoryStructure[])directories.ToArray(typeof(IDirectoryStructure));

            base.backgroundWorker_Execute(taskStruct);
        }
Exemplo n.º 2
0
        private void IsoExtractorForm_DragDrop(object sender, DragEventArgs e)
        {
            string[] s = (string[])e.Data.GetData(DataFormats.FileDrop, false);

            IsoExtractorWorker.IsoExtractorStruct taskStruct =
                new IsoExtractorWorker.IsoExtractorStruct();
            taskStruct.SourcePaths = s;

            try
            {
                IVolume[] volumes = IsoExtractorWorker.GetVolumes(s[0]);

                this.IsoFolderTreeView.Nodes.Clear();
                this.fileListView.Items.Clear();

                LoadTreeWithVolumes(volumes);
                this.sourceFile = s[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }