2using System.Collections.Generic;
11 private readonly SortedDictionary<string, bool> suggestions;
12 private readonly
string startsWith;
19 this.suggestions =
new SortedDictionary<string, bool>(StringComparer.CurrentCultureIgnoreCase);
34 if (Suggestion.StartsWith(
this.startsWith, StringComparison.InvariantCultureIgnoreCase) &&
35 !
this.suggestions.ContainsKey(Suggestion))
37 this.suggestions[Suggestion] =
true;
47 string[] Result =
new string[this.suggestions.Count];
48 this.suggestions.Keys.CopyTo(Result, 0);
Event arguments for suggestion event handlers.
void AddSuggestion(string Suggestion)
Adds a suggestion.
string StartsWith
Only suggestions starting with this string will be returned.
SuggestionEventArgs(string StartsWith)
Event arguments for suggestion event handlers.
string[] ToArray()
Returns suggestions, as an array of strings.