void KeyDownHandler(object sender, KeyEventArgs a) { VgcApis.Misc.Utils.RunInBackground( () => VgcApis.Misc.UI.Invoke(() => { editorCtrl?.KeyBoardShortcutHandler(a); acmCtrl?.KeyBoardShortcutHandler(a); })); }
private void FormEditor_Load(object sender, System.EventArgs e) { InitSplitPanel(); lbStatusBarMsg.Text = ""; editorCtrl = new Controllers.FormEditorCtrl.ButtonCtrl( this, editor, cboxScriptName, btnNewScript, btnSaveScript, btnRunScript, btnStopScript, btnKillScript, btnClearOutput, btnShowFormSearch, btnGotoLine, tboxQuickSearch, rtBoxOutput); acmCtrl = new Controllers.FormEditorCtrl.AutoCompleteCtrl( editor, cboxVarList, cboxFunctionList, enableCodeAnalyzeToolStripMenuItem, toolStripStatusCodeAnalyze); acmCtrl.Run(settings); editorCtrl.Run(api, settings, formMgr, luaServer); menuCtrl = new Controllers.FormEditorCtrl.MenuCtrl( this, editorCtrl, newWindowToolStripMenuItem, showScriptManagerToolStripMenuItem, loadFileToolStripMenuItem, saveAsToolStripMenuItem, exitToolStripMenuItem, loadCLRLibraryToolStripMenuItem, toolStripStatusClrLib, cboxScriptName); menuCtrl.Run(formMgr, initialCoreSettings); this.FormClosing += FormClosingHandler; this.FormClosed += (s, a) => { acmCtrl.Cleanup(); editorCtrl.Cleanup(); }; this.KeyDown += (s, a) => { VgcApis.Misc.Utils.RunInBackground( () => VgcApis.Misc.UI.Invoke(() => { editorCtrl?.KeyBoardShortcutHandler(a); acmCtrl?.KeyBoardShortcutHandler(a); })); }; }