Beispiel #1
0
 /// <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();
 }
Beispiel #2
0
        /// <summary>
        /// Insert the currently selected completion item into the text box.
        /// </summary>
        private void InsertCompletionItemIntoTextBox()
        {
            string         insertText = null;
            TreePath       selPath;
            TreeViewColumn selCol;

            CompletionView.GetCursor(out selPath, out selCol);
            if (selPath != null)
            {
                TreeIter iter;
                completionModel.GetIter(out iter, selPath);
                insertText = (string)completionModel.GetValue(iter, 1);
            }
            if (!String.IsNullOrEmpty(insertText))
            {
                textEditor.Document.ReadOnly = false;
                textEditor.InsertAtCaret(insertText);
            }
            HideCompletionWindow();
        }