Exemple #1
0
 //Изучение колоды
 private void bLearnCardList_Click(object sender, EventArgs e)
 {
     try
     {
         if (CardListComboBox.SelectedItem == null)
         {
             throw new Exception();
         }
         this.Deck = new CardList(CardListComboBox.SelectedItem.ToString());
         Deck.SetCurrent(0);
         db = new DataBase();
         int size = Convert.ToInt32(db.GetCountCardList(Deck));
         if (size < 3)
         {
             MessageBox.Show("Для того, чтобы учить колоду, в ней должно быть не менее трёх карт.", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             ReviewForm reviewform = new ReviewForm(Deck);
             reviewform.StyleManager = this.StyleManager;
             reviewform.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Выберите колоду, с которой вы будете работать.", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #2
0
        private void LearningButton_Click(object sender, EventArgs e)
        {
            StreamReader read = new StreamReader("NameOfLastDeck.txt");
            string       name;

            name = read.ReadLine();
            read.Close();
            if (name == null)
            {
                MessageBox.Show("Вы ещё не открывали ни одну колоду");
            }
            else
            {
                ReviewForm learning = new ReviewForm(name);
                learning.StyleManager = this.StyleManager;
                learning.ShowDialog();
            }
        }