private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Title = "Select the TPF file to open"; open.Filter = "TPF File|*.tpf"; if (open.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } TPFExtract newtpf = new TPFExtract(open.FileName, Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "exec"), true); this.Close(); }
public TPFView(TPFExtract tpf) { InitializeComponent(); _tpf = tpf; for (int i = 0; i < _tpf.GetNumEntries(); i++) { listBox1.Items.Add(_tpf.GetEntry(i).Filename); } uint unc = 0; uint cpr = 0; for (int i = 0; i < _tpf.GetNumEntries(); i++) { unc += _tpf.GetEntry(i).UncomprSize; cpr += _tpf.GetEntry(i).ComprSize; } rtb4.Text = "TPF File Info\n\nFilename: " + _tpf.GetFilename() + "\nStored Files: " + _tpf.GetNumEntries() + "\nAverage Compression Ratio: " + ((float)cpr / unc) + "\nComment:\n" + _tpf.GetComment(); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Title = "Select the TPF file to open"; open.Filter = "TPF File|*.tpf"; if (open.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; TPFExtract newtpf = new TPFExtract(open.FileName, Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "exec"), true); this.Close(); }