Esempio n. 1
0
 private void ButtonBergerNext_Practice_Click(object sender, RoutedEventArgs e)
 {
     if (bergerPracticeEncode ?
         BergerService.isEncodedCorrectly(lblTask_Practice.Content.ToString(), txbBergerResult_Practice.Text) :
         BergerService.isDecodedCorrectly(lblTask_Practice.Content.ToString(), txbBergerResult_Practice.Text))
     {
         MessageBox.Show("Правильно!");
     }
     else
     {
         MessageBox.Show("Не правильно! Ответ: " + (bergerPracticeEncode ?
                                                    BergerService.encode(lblTask_Practice.Content.ToString()) :
                                                    BergerService.decode(lblTask_Practice.Content.ToString())));
     }
 }
Esempio n. 2
0
        private void Button_Berger_Next_Click(object sender, RoutedEventArgs e)
        {
            Result result = results["Berger"];

            if (result.currentTestNumber <= 6)
            {
                if (result.currentTestNumber <= 3 ?
                    BergerService.isEncodedCorrectly(lblBergerTask.Content.ToString(), txbBergerResult.Text) :
                    BergerService.isDecodedCorrectly(lblBergerTask.Content.ToString(), txbBergerResult.Text))
                {
                    MessageBox.Show("Правильно!");
                    result.correctTests      += 1;
                    result.currentTestNumber += 1;
                }
                else
                {
                    MessageBox.Show("Не правильно! Ответ: " + (result.currentTestNumber <= 3 ?
                                                               BergerService.encode(lblBergerTask.Content.ToString()) :
                                                               BergerService.decode(lblBergerTask.Content.ToString())));
                    result.currentTestNumber += 1;
                }
                GenerateBergerTest();
            }
        }