protected override IEnumerable <AbstractAutoSuggestResult> GetSuggestions(AbstractEditingContext context) { if (Settings.Enabled) { string prefix = context.GetAllPrefixes().FirstOrDefault(); if (!string.IsNullOrEmpty(prefix) && _candidates != null && _candidates.Count > 0) { return(_candidates.Where( item => item.StartsWith(prefix, Settings.CaseSensitive ? StringComparison.InvariantCulture : StringComparison.InvariantCultureIgnoreCase)).Select( item => { var result = new AutoSuggestTextResult(context, item) { Priority = Settings.Priority, Icon = Icon }; return result; })); } } return(null); }
protected override IEnumerable <AbstractAutoSuggestResult> GetSuggestions(AbstractEditingContext context) { if (Settings.Enabled) { string suffix = context.GetAllPrefixes().First(); if (!string.IsNullOrEmpty(suffix) && _segmentWordSuggestCandidates != null && _segmentWordSuggestCandidates.Count > 0) { return(_segmentWordSuggestCandidates .Where(item => item.StartsWith(suffix, Settings.CaseSensitive ? StringComparison.InvariantCulture : StringComparison.InvariantCultureIgnoreCase)) .Select(item => { var result = new AutoSuggestTextResult(context, item); result.Priority = Settings.Priority; // Set different icon for suggestions starting with "a". For the rest set the default provider icon result.Icon = result.Text.StartsWith("a") ? new Icon(SystemIcons.Question, 16, 16) : Icon; return result; })); } } return(null); }