private void CaretPositionChanged(object sender, EventArgs e) { var offset = TextArea.Caret.Offset; if (offset == StartOffset) { if (CloseAutomatically && CloseWhenCaretAtBeginning) { Hide(); } else { _completionList.SelectItem(string.Empty); } return; } if (offset < StartOffset || offset > EndOffset) { if (CloseAutomatically) { Hide(); } } else { var document = TextArea.Document; if (document != null) { _completionList.SelectItem(document.GetText(StartOffset, offset - StartOffset)); } } }
public void Show(string e) { if (!string.IsNullOrEmpty(e)) { CompletionList.SelectItem(e); } if (CompletionList.ListBox.ItemCount > 0) { Show(); } }