/// <summary> /// Invoked when the user selects an item in the intellisense window. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { try { // The completion options in the series filter will typically contain the trigger word, // e.g. "Maize.Total.Wt". We don't want to end up with "Maize.Maize.Total.Wt". if (args.ItemSelected.StartsWith(args.TriggerWord)) { int index = args.ItemSelected.IndexOf(args.TriggerWord); if (index >= 0) { args.ItemSelected = args.ItemSelected.Substring(args.TriggerWord.Length); } } string textBeforeCursor = seriesView.Filter.Text.Substring(0, seriesView.Filter.Offset); if (textBeforeCursor.EndsWith(".") && args.ItemSelected.StartsWith(".")) { args.ItemSelected = args.ItemSelected.TrimStart('.'); } seriesView.Filter.InsertAtCursor(args.ItemSelected); } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { if (string.IsNullOrEmpty(args.ItemSelected)) { return; } else if (string.IsNullOrEmpty(args.TriggerWord)) { if (currentEditor is IEditorView) { (currentEditor as IEditorView).InsertAtCaret(args.ItemSelected); } else { (currentEditor as IEditView).InsertAtCursor(args.ItemSelected); } } else { if (currentEditor is IEditorView) { (currentEditor as IEditorView).InsertCompletionOption(args.ItemSelected, args.TriggerWord); } else { (currentEditor as IEditView).InsertCompletionOption(args.ItemSelected, args.TriggerWord); } } }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { managerView.Editor.InsertCompletionOption(args.ItemSelected, args.TriggerWord); if (args.IsMethod) { intellisense.ShowScriptMethodCompletion(manager, managerView.Editor.Text, managerView.Editor.Offset, managerView.Editor.GetPositionOfCursor()); } }
/// <summary> /// Insert the currently selected completion item into the text box. /// </summary> private void InsertCompletionItemIntoTextBox(object sender, IntellisenseItemSelectedArgs e) { if (!String.IsNullOrEmpty(e.ItemSelected)) { textEditor.Document.ReadOnly = false; textEditor.InsertAtCaret(e.ItemSelected); } textEditor.Document.ReadOnly = false; textEditor.GrabFocus(); }
/// <summary> /// Invoked when the user selects a completion option. /// Removes the intellisense popup, and displays the method completion popup /// if the selected item is a method. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event Arguments.</param> private void ContextItemSelected(object sender, NeedContextItemsArgs.ContextItem args) { IntellisenseItemSelectedArgs itemSelectedArgs = new IntellisenseItemSelectedArgs() { TriggerWord = triggerWord, ItemSelected = args.Name + (args.IsMethod ? "(" : ""), IsMethod = args.IsMethod }; OnItemSelected?.Invoke(this, itemSelectedArgs); }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { if (string.IsNullOrEmpty(args.ItemSelected)) { factorView.InsertAtCaret(args.ItemSelected); } else { factorView.InsertCompletionOption(args.ItemSelected, args.TriggerWord); } }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { try { view.Grid2.InsertText(args.ItemSelected); } catch (Exception err) { presenter.MainPresenter.ShowError(err); } }
/// <summary> /// Invoked when the user selects an item in the intellisense window. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { try { seriesView.Filter.InsertCompletionOption(args.ItemSelected, args.TriggerWord); } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { if (string.IsNullOrEmpty(args.ItemSelected)) { factorView.Specification.InsertAtCursorInSquareBrackets(args.ItemSelected); } else { factorView.Specification.InsertCompletionOption(args.ItemSelected, args.TriggerWord); } }
private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { try { columnFilterEditBox.InsertCompletionOption(args.ItemSelected, args.TriggerWord); PopulateGrid(); } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { try { managerView.Editor.InsertCompletionOption(args.ItemSelected, args.TriggerWord); if (args.IsMethod) { intellisense.ShowScriptMethodCompletion(manager, managerView.Editor.Text, managerView.Editor.Offset, managerView.Editor.GetPositionOfCursor()); } } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { if (string.IsNullOrEmpty(args.TriggerWord)) { view.InsertAtCaret(args.ItemSelected); } else { int position = view.Text.Substring(0, view.Offset).LastIndexOf(args.TriggerWord); view.InsertCompletionOption(args.ItemSelected, args.TriggerWord); } if (args.IsMethod) { Point cursor = view.GetPositionOfCursor(); intellisense.ShowMethodCompletion(operations, view.Text, view.Offset, new Point(cursor.X, cursor.Y)); } }
private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { try { if (string.IsNullOrEmpty(args.ItemSelected)) { return; } else if (string.IsNullOrEmpty(args.TriggerWord)) { currentEditor.InsertAtCaret(args.ItemSelected); } else { currentEditor.InsertCompletionOption(args.ItemSelected, args.TriggerWord); } } catch (Exception err) { presenter.MainPresenter.ShowError(err); } }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { grid.InsertText(args.ItemSelected); }
/// <summary> /// Invoked when the user selects an item in the intellisense. /// Inserts the selected item at the caret. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs args) { view.InsertCompletionOption(args.ItemSelected, args.TriggerWord); }
/// <summary> /// Called when an intellisense item is selected. /// Inserts the item into view.Grid2 (the lower gridview). /// </summary> /// <param name="sender">Sender object.</param> /// <param name="e">Event arguments.</param> private void OnIntellisenseItemSelected(object sender, IntellisenseItemSelectedArgs e) { view.Grid2.InsertText(e.ItemSelected); }