private void listViewContextExtract_Click(object sender, EventArgs e) { var dlg = new FolderBrowserDialog(); dlg.Description = "File destination"; if (dlg.ShowDialog() != DialogResult.OK) { return; } // Extract single file directly to choosen folder ArrayList selectedObjects = listView.GetSelectedObjects(); if (selectedObjects == null || selectedObjects.Count == 0) { return; } else if (selectedObjects.Count == 1) { string nameHash = (selectedObjects[0] as RoGrfFileItem).NameHash; mGrfFile.ExtractFile(dlg.SelectedPath, nameHash, true, true); mGrfFile.Flush(); return; } // Extract more than one file using (var frm = new FrmExtract(mGrfFile, dlg.SelectedPath, listView.GetSelectedObjects())) { if (frm.ShowDialog(this) != DialogResult.OK) { return; } } mGrfFile.Flush(); }
private void listViewContextExtractAll_Click(object sender, EventArgs e) { var dlg = new FolderBrowserDialog(); dlg.Description = "File destination"; if (dlg.ShowDialog() != DialogResult.OK) { return; } using (var frm = new FrmExtract(mGrfFile, dlg.SelectedPath, new ArrayList())) { if (frm.ShowDialog(this) != DialogResult.OK) { return; } } mGrfFile.Flush(); }