public SuggestedTextChangedEventArgs( string text, string suggestedText, TextPosition startPosition, TextPosition endPosition, AutoCompleteAction action) { this.text = text; this.suggestedText = suggestedText; this.action = action; this.startPosition = startPosition; this.endPosition = endPosition; }
protected virtual void SuggestOverride(string pattern) { int selectedIndex = this.SelectedIndex; this.patternText = pattern; this.SuspendSuggestNotifications(); if (selectedIndex >= 0) { RadListDataItem radListDataItem = this.Items[selectedIndex]; radListDataItem.Selected = false; radListDataItem.Active = false; } this.DataLayer.Refresh(); this.SelectedIndex = -1; this.ResumeSuggestNotifications(); RadListDataItemCollection items = this.DataLayer.Items; int count = items.Count; if (count > 0) { this.UpdateLayout(); this.ScrollToItem(items.First); } bool flag = this.IsAppendMode && count > 0; string str = string.Empty; if (flag) { str = this.GetSuggestedText(items.First, true); } else if (!this.IsSuggestMode && this.IsAppendMode) { str = this.patternText; } else if (count == 1) { str = this.GetSuggestedText(items.First, false); } AutoCompleteAction action = AutoCompleteAction.None; if (flag && !this.IsExactSuggestion(str, this.patternText)) { action = AutoCompleteAction.Append; } this.SetSuggestedText(str, action); }
protected void SetSuggestedText(string text, AutoCompleteAction action) { this.suggestedText = text; this.OnSuggestedTextChanged(action); }
protected void OnSuggestedTextChanged(AutoCompleteAction action) { this.OnSuggestedTextChanged(new SuggestedTextChangedEventArgs(this.patternText, this.suggestedText, this.startPosition, this.endPosition, action)); }