Esempio n. 1
0
        internal void OnKeyInput(KeyboardEventArgs args)
        {
            switch (args.Key)
            {
            case "Enter":
            case "Tab":
            case "ArrowRight":
                if (ShowSuggestions)
                {
                    AddWord(SuggestionIterator.Current);
                }
                break;

            case "Backspace":
                if (string.IsNullOrEmpty(WordModel.WordInput) && WordModel.AddedWords.Count != 0)
                {
                    DeleteWord(WordModel.AddedWords.Last());
                }
                break;

            case "ArrowUp":
                SuggestionIterator.MoveBefore();
                break;

            case "ArrowDown":
                SuggestionIterator.MoveNext();
                break;
            }
        }
 internal WordHandler(IWordModel WordModel, Func <IList <string>, Task> searcher, Func <Task> resetter)
 {
     this.WordModel     = WordModel;
     SearchBehaviors    = new SearchHandler(WordModel, searcher, resetter);
     SuggestionIterator = new SuggestionIterator(this.WordModel.AvailableWordList.ToList());
 }