public void Write(KBF kbf) { FileStream stream = new FileStream(kbf.FullFileName, FileMode.Open, FileAccess.Write); kbf.Write(stream); stream.Close(); }
private void mnuNew_Click(object sender, EventArgs e) { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "K&K Binary Resource File|*.kbf"; if (dialog.ShowDialog() == DialogResult.OK) { var stream = new FileStream(dialog.FileName, FileMode.OpenOrCreate, FileAccess.Write); currentFile = new KBF(stream.Name); currentFile.Write(stream); stream.Close(); Text = originalText + " - " + dialog.FileName; mnuImportMesh.Enabled = true; mnuImportMaterialScript.Enabled = true; mnuImportTexture.Enabled = true; mnuSaveFile.Enabled = true; } }