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(); } }
private void UnknownWordsTestForm_Load(object sender, EventArgs e) { CommonFormService.InitializeTestTimer(TestTimerLabel, _stopWatch); VerbalFormService.SetWordTextBoxVisibilityForSelectedLanguage(_selectedLanguage, FirstLanguageWordTextBox, SecondLanguageWordTextBox); VerbalFormService.HanldeVerbalFormLoadedEvent(NextWordButton, _unknownWords, out _currentUnknownWordPairId, ProgressLabel, FirstLanguageWordTextBox, SecondLanguageWordTextBox); LearnedWordsCountLinkLabel.Enabled = false; }