private void exportClipboard_Click(object sender, EventArgs e) { string LevelFilename = (string)levelTreeView.SelectedNode.Tag; DSFileSystem.File LevelFile = ROM.getLevelFile(LevelFilename); DSFileSystem.File BGFile = ROM.getBGDatFile(LevelFilename); ByteArrayInputStream strm = new ByteArrayInputStream(new byte[0]); BinaryWriter bw = new BinaryWriter(strm); new ExportedLevel(LevelFile, BGFile).Write(bw); ClipboardLevelSource.copyData(strm.getData()); bw.Close(); }
private void importClipboard_Click(object sender, EventArgs e) { if (MessageBox.Show((LanguageManager.Get("LevelChooser", "replaceclipboard")), (LanguageManager.Get("LevelChooser", "replaceclipboardtitle")), MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } try { string LevelFilename = (string)levelTreeView.SelectedNode.Tag; DSFileSystem.File LevelFile = ROM.getLevelFile(LevelFilename); DSFileSystem.File BGFile = ROM.getBGDatFile(LevelFilename); ClipboardLevelSource level = new ClipboardLevelSource(); level.level.Import(LevelFile, BGFile); } catch (Exception ex) { MessageBox.Show((LanguageManager.Get("LevelChooser", "clipinvalidlevel"))); } }