void HandleTextChange() { quickSearchTimerTask = QuickSearchTimer(++currentQuickSearchTimerId); TryUpdateSelectedSuggestion(); if (!currentSuggestionUpdateLock && currentSuggestion != null) { currentSuggestion = null; textEditingRestricted = false; OnCurrentSuggestionChanged?.Invoke(this, EventArgs.Empty); } }
void HandleTextChange() { if (textChangeHandlingLock) { return; } view.ResetQuickSearchTimer(500); TryUpdateSelectedSuggestion(); if (!currentSuggestionUpdateLock && currentSuggestion != null) { currentSuggestion = null; view.RestrictTextEditing(false); OnCurrentSuggestionChanged?.Invoke(this, EventArgs.Empty); } }
bool TryUseSuggestion(int suggestionIndex, bool ignoreListVisibility) { if (!TryHideSuggestions() && !ignoreListVisibility) { return(false); } if (!ValidateSuggestionIndex(suggestionIndex, ignoreSelectability: false)) { return(false); } var suggestion = suggestions[suggestionIndex].data.Value; using (new ScopedGuard( () => currentSuggestionUpdateLock = true, () => currentSuggestionUpdateLock = false)) { SetText(suggestion.SearchString ?? suggestion.DisplayString); textEditingRestricted = suggestion.SearchString == null; currentSuggestion = suggestion; OnCurrentSuggestionChanged?.Invoke(this, EventArgs.Empty); } return(true); }