Example #1
0
 private void passCard_Click(object sender, EventArgs e)
 {
     if (comboBox2.Text == "")
     {
         errorProvider1.SetError(comboBox2, "You did not select card.");
         return;
     }
     else
     {
         errorProvider1.SetError(passCard, null);
         errorProvider1.SetError(comboBox2, null);
         if (currentCard != null && p.CheckCards(currentCard, comboBox2.Text))
         {
             p.GiveCard(comboBox2.Text);
             currentCard  = comboBox2.Text;
             upLabel.Text = "current card: " + currentCard;
             updateListOfMyCard();
             prepareHighcores();
             itIsNotPlayersRound();
             lookForWinner();
             return;
         }
         else
         {
             errorProvider1.SetError(passCard, null);
             if (currentCard != null)
             {
                 errorProvider1.SetError(passCard, "You do not have required card.");
                 return;
             }
             else
             {
                 p.GiveCard(comboBox2.Text);
                 currentCard  = comboBox2.Text;
                 upLabel.Text = "current card: " + currentCard;
                 updateListOfMyCard();
                 prepareHighcores();
                 itIsNotPlayersRound();
                 lookForWinner();
                 return;
             }
         }
     }
 }