public void ShowHint(TextBufferLocation hintLocation, string text, string highlightText) { if (this._autoCompleteHint == null) { this._autoCompleteHint = new AutoCompleteLabel(text, highlightText); int x = (((this._fontWidth * (this.GetViewIndex(hintLocation) - this.ViewLeftIndex)) + this.MarginPadding) + this.MarginWidth) + this._lineNumbersWidth; int y = ((hintLocation.LineIndex + 1) - this.ViewTopLineNumber) * this._fontHeight; if ((this._autoCompleteHint.Height + y) > base.Height) { y = (y - this._autoCompleteHint.Height) - this._fontHeight; if (y < 0) { this.HideHint(); return; } } if ((this._autoCompleteHint.Width + x) > base.Width) { x -= this._autoCompleteHint.Width; if (x < 0) { this.HideHint(); return; } } this._autoCompleteHint.Location = new Point(x, y); base.Controls.Add(this._autoCompleteHint); this._autoCompleteHint.Visible = true; } else if (text == this._autoCompleteHint.Text) { this.SetHintHighlightText(highlightText); } }
public void HideHint() { if (this._autoCompleteHint != null) { this._autoCompleteHint.Visible = false; base.Controls.Remove(this._autoCompleteHint); this._autoCompleteHint.Dispose(); this._autoCompleteHint = null; } }