private void addCharsetButton_Click(object sender, EventArgs e) { using (var dlg = new NewCharSetDialog()) { if (dlg.ShowDialog() == DialogResult.OK) { CharSetEditor editor = new CharSetEditor(dlg.CharSetName, dlg.CharWidth, dlg.CharHeight, dlg.CharSetSort, dlg.CharSetType); editor.MdiParent = this; editor.Export += Editor_Export; editor.Save += Editor_Save; editor.Update += Editor_Update; editor.FormClosed += Editor_FormClosed; editor.Show(); } } }
private void CsManager_CharSetSelected(object sender, CharSetEventArgs e) { var existing = MdiChildren.FirstOrDefault(c => (c as CharSetEditor)?.CharSetId == e.CharSet.Id); if (existing != null) { existing.BringToFront(); return; } CharSetEditor editor = new CharSetEditor(e.CharSet); editor.MdiParent = this; editor.Export += Editor_Export; editor.Save += Editor_Save; editor.Update += Editor_Update; editor.FormClosed += Editor_FormClosed; editor.Show(); }