public TextEditForm(MainForm mainForm, MyScriptableNode target) { InitializeComponent(); //Icon = Properties.Resources.TextDoc; m_mainForm = mainForm; Target = target; Text = target.Name; SetupEditorStyle(); scintilla.Text = Target.Script; scintilla.TextChanged += scintilla_TextChanged; scintilla.HandleDestroyed += scintilla_HandleDestroyed; scintilla.HandleCreated += scintilla_HandleCreated; }
internal void CloseTextEditor(MyScriptableNode target) { TextEditForm textEditor; if (TextEditors.TryGetValue(target, out textEditor)) { textEditor.Close(); } }
public TextEditForm OpenTextEditor(MyScriptableNode target) { TextEditForm textEditor; if (!TextEditors.TryGetValue(target, out textEditor)) { textEditor = new TextEditForm(this, target); textEditor.FormClosed += textEditor_FormClosed; TextEditors[target] = textEditor; } textEditor.Show(dockPanel, DockState.Document); return textEditor; }