public static void InitSuggestionProvider(List <string> keywords, ListBox box, RichTextBox textBox) { SuggestionHelper sg = new SuggestionHelper(); keywords = sg.GetSuggestionList(); keywordList = keywords; suggestionBox = box; editor = textBox; }
/// <summary> /// Get the top package search suggestions for the data catalog group. /// </summary> /// <param name="prefix"></param> /// <param name="suggestionCount"></param> /// <param name="searchParameters"></param> /// <param name="cacheSettings"></param> /// <returns></returns> public List <string> GetPackageSearchSuggestions(string prefix, int suggestionCount, PackageSearchParameters searchParameters, CacheSettings cacheSettings) { var list = new List <string>(); var trie = SuggestionHelper.GetTrie(this, searchParameters, cacheSettings); if (trie != null) { list = trie.GetCompletionList(prefix); list.Sort(); list = list.Take(suggestionCount).ToList(); } return(list); }