private void listViewResults_DoubleClick(object sender, EventArgs e) { Point p = this.searchControl.listViewResults.PointToClient(MousePosition); int index = this.searchControl.listViewResults.GetItemAt(p.X, p.Y).Index; if (index >= 0) { Script script = this.results[index].Script; var page = new ScriptEditorForm(script); page.Show(Editor.MainDock); page.ScintillaControl.Lines[this.results[index].Line].Select(); } }
/// <summary> /// Creates a script editor panel and puts it in the opened script list /// </summary> /// <param name="file">The path of the script</param> /// <param name="show">Flag to display the script window</param> /// <returns>The instance of the associated script window</returns> public static ScriptEditorForm OpenScript(string file, bool show = false) { Script script = Project.ScriptManager.WithPath(file) ?? new Script(file); ScriptEditorForm editor = Windows.ScriptEditors.Find(e => e.Script == script); if (editor == null) { editor = new ScriptEditorForm(script); Windows.ScriptEditors.Add(editor); } if (show) { if (editor.DockPanel == null && !editor.IsFloat) { editor.Show(MainDock); editor.DockPanel.ContextMenuStrip = Windows.ScriptTabContextMenu; } MainDock.ActiveContent.DockHandler.Activate(); editor.Activate(); } return editor; }