/// <summary> /// Edit the selected text editor entry. /// </summary> /// <param name="sender">system parameter</param> /// <param name="e">system parameter</param> private void TextEditorsList_DoubleClick(object sender, EventArgs e) { Point clientPoint = TextEditorsList.PointToClient(Control.MousePosition); ListViewItem item = TextEditorsList.GetItemAt(clientPoint.X, clientPoint.Y); if (item != null) { item.Selected = true; btnEdit_Click(null, null); } }
/// <summary> /// Loads the given text editors. /// </summary> /// <param name="editors">TextEditor array, can be nothing</param> private void LoadEditors(TextEditor[] editors) { if (editors != null) { TextEditorsList.BeginUpdate(); foreach (TextEditor editor in editors) { ListViewItem item = new ListViewItem(); item.Text = editor.FileType; item.SubItems.Add(editor.Editor); item.SubItems.Add(editor.Arguments); item.SubItems.Add(editor.TabSize.ToString()); item.Selected = true; item.Tag = editor; TextEditorsList.Items.Add(item); } TextEditorsList.EndUpdate(); } }