SelectItemWithStart() public method

public SelectItemWithStart ( string startText ) : void
startText string
return void
Esempio n. 1
0
        protected override void CaretOffsetChanged(object sender, EventArgs e)
        {
            int offset = control.ActiveTextAreaControl.Caret.Offset;

            if (guiLoaded.isFalse()) //DC, means the Window is not loaded (i.e first pass)
            {
                return;
            }

            if (offset == startOffset)
            {
                if (CloseWhenCaretAtBeginning)
                {
                    Close();
                }
                return;
            }
            if (offset < startOffset || offset > endOffset)
            {
                Close();
            }
            else
            {
                codeCompletionListView.SelectItemWithStart(control.Document.GetText(startOffset, offset - startOffset));
            }
        }
        protected override void CaretOffsetChanged(object sender, EventArgs e)
        {
            int offset = control.ActiveTextAreaControl.Caret.Offset;

            if (offset == startOffset)
            {
                if (CloseWhenCaretAtBeginning)
                {
                    Close();
                }
                return;
            }
            if (offset < startOffset || offset > endOffset)
            {
                Close();
            }
            else
            {
                //Console.WriteLine(startOffset + 1);
                //Console.WriteLine(control.Text.Length);
                string charBeforeWord = control.Document.GetText(startOffset, 1);


                if (startOffset + 1 < control.Text.Length)
                {
                    if (((charBeforeWord == "<") || (charBeforeWord == " ")) && startOffset + 1 < control.Text.Length)
                    {
                        if (codeCompletionListView != null)
                        {
                            codeCompletionListView.SelectItemWithStart(control.Document.GetText(startOffset + 1, (offset - startOffset) - 1));
                        }
                    }
                    else
                    if (codeCompletionListView != null)
                    {
                        codeCompletionListView.SelectItemWithStart(control.Document.GetText(startOffset, (offset - startOffset)));
                    }
                }
            }
        }
Esempio n. 3
0
        protected override void CaretOffsetChanged(object sender, EventArgs e)
        {
            int offset = control.ActiveTextAreaControl.Caret.Offset;

            //Console.WriteLine("StartOffset {0} endOffset {1} - Offset {2}", startOffset, endOffset, offset);
            if (offset < startOffset || offset > endOffset)
            {
                Close();
            }
            else
            {
                codeCompletionListView.SelectItemWithStart(control.Document.GetText(startOffset, offset - startOffset));
            }
        }
		protected override void CaretOffsetChanged(object sender, EventArgs e)
		{
			int offset = control.ActiveTextAreaControl.Caret.Offset;
			if (offset == startOffset) {
				if (CloseWhenCaretAtBeginning)
					Close();
				return;
			}
			if (offset < startOffset || offset > endOffset) {
				Close();
			} else {
				codeCompletionListView.SelectItemWithStart(control.Document.GetText(startOffset, offset - startOffset));
			}
		}
Esempio n. 5
0
        public void ShowEntriesThatMatchText(string text)
        {
            if (text.contains("d1"))
            {
                "aa".o2Cache(this);
                //this.codeCompletionListView.insert_Below(20);
            }
            codeCompletionListView.pink();
            //if (text.contains("d"))
            if (text.valid())
            {
                var lowerText = text.lower();

                var newCompletionData = new List <ICompletionData>();
                foreach (var item in completionData)
                {
                    if (item.Text.lower().contains(lowerText))
                    {
                        newCompletionData.add(item);
                    }
                }
                //completionData.Take(20).ToArray();

                this.codeCompletionListView.completionData = newCompletionData.ToArray();
                this.vScrollBar.Maximum = newCompletionData.size();
                this.codeCompletionListView.ClearSelection();
                this.codeCompletionListView.Refresh();
                this.Refresh();
            }
            else
            {
                this.vScrollBar.Maximum = completionData.size();
                this.codeCompletionListView.completionData = completionData;
            }

            codeCompletionListView.SelectItemWithStart(text);
        }