コード例 #1
0
        private void HandleNextWordButtonClickedEvent()
        {
            if (IDontKnowTheWordButton.Visible)
            {
                _learnedWords.Add(_unknownWords.First(uw => uw.Id == _currentUnknownWordPairId));
                LearnedWordsCountLinkLabel.Text    = _learnedWords.Count.ToString();
                LearnedWordsCountLinkLabel.Enabled = _learnedWords.Count > 0;

                _unknownWords = _unknownWords.Where(unknownWord => unknownWord.Id != _currentUnknownWordPairId).ToArray();
            }
            else
            {
                VerbalFormService.SetWordTextBoxVisibilityForSelectedLanguage(_selectedLanguage, FirstLanguageWordTextBox, SecondLanguageWordTextBox);
            }

            VerbalFormService.HandleNextWordButtonClickedEvent(IDontKnowTheWordButton, FirstLanguageWordTextBox, SecondLanguageWordTextBox, _selectedLanguage);

            if (_unknownWords.Length > 0)
            {
                CommonFormService.SetProgressLabelText(ProgressLabel, _unknownWords);

                WordPair nextWord = _unknownWords.First();

                FirstLanguageWordTextBox.Text  = nextWord.FirstLanguageWord;
                SecondLanguageWordTextBox.Text = nextWord.SecondLanguageWord;

                _currentUnknownWordPairId = nextWord.Id;
            }
            else
            {
                HandleFinishedTest();
            }
        }
コード例 #2
0
        private void HandleCorrectlyEnteredWord()
        {
            WordPair currentLearnedWord = _allWords.First(uw => uw.Id == _currentWordPairId);
            bool     learnedUnknownWord = _wordsService.RemoveLearnedUnknownWordIfExist(currentLearnedWord);

            if (learnedUnknownWord)
            {
                _learnedWords.Add(currentLearnedWord);
                NewLearnedWordsCountLinkLabel.Text = _learnedWords.Count.ToString();
            }
            else
            {
                _knownWords.Add(currentLearnedWord);
                KnownWordsCountLinkLabel.Text = _knownWords.Count.ToString();
            }

            _allWords = _allWords.Where(aw => aw.Id != _currentWordPairId).ToArray();

            NewLearnedWordsCountLinkLabel.Enabled = _learnedWords.Count > 0;
            KnownWordsCountLinkLabel.Enabled      = _knownWords.Count > 0;

            if (_allWords.Length > 0)
            {
                CommonFormService.SetProgressLabelText(ProgressLabel, _allWords);
                _currentWordPairId = _allWords.First().Id;

                GrammarFormService.HandleNextWordButtonEvent(ValidateWordButton, NextWordButton,
                                                             CorrectWordTextBox, _selectedLanguage, FirstLanguageWordTextBox, SecondLanguageWordTextBox,
                                                             _allWords);
            }
            else
            {
                HandleFinishedTest();
            }
        }
コード例 #3
0
        private void HandleNextWordButtonEvent()
        {
            if (_allWords.Length > 0)
            {
                CommonFormService.SetProgressLabelText(ProgressLabel, _allWords);

                GrammarFormService.HandleNextWordButtonEvent(ValidateWordButton, NextWordButton,
                                                             CorrectWordTextBox, _selectedLanguage, FirstLanguageWordTextBox, SecondLanguageWordTextBox,
                                                             _allWords);
            }
            else
            {
                HandleFinishedTest();
            }
        }
コード例 #4
0
        private void HandleCorrectlyEnteredWord()
        {
            _learnedWords.Add(_unknownWords.First(uw => uw.Id == _currentUnknownWordPairId));
            LearnedWordsCountLinkLabel.Text = _learnedWords.Count.ToString();

            LearnedWordsCountLinkLabel.Enabled = _learnedWords.Count > 0;

            _unknownWords = _unknownWords.Where(unknownWord => unknownWord.Id != _currentUnknownWordPairId).ToArray();

            if (_unknownWords.Length > 0)
            {
                CommonFormService.SetProgressLabelText(ProgressLabel, _unknownWords);
                _currentUnknownWordPairId = _unknownWords.First().Id;

                GrammarFormService.HandleNextWordButtonEvent(ValidateWordButton, NextWordButton,
                                                             CorrectWordTextBox, _selectedLanguage, FirstLanguageWordTextBox, SecondLanguageWordTextBox,
                                                             _unknownWords);
            }
            else
            {
                HandleFinishedTest();
            }
        }