예제 #1
0
 private void ExitButton_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do you really want to exit?", "Backgammon", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0x40000) == DialogResult.Yes)
     {
         game.EndGame();
     }
 }
예제 #2
0
        //Interprate Information message
        public void UnpackIMessage(string mess)
        {
            int code = int.Parse(mess.Substring(2, 2));

            switch (code)
            {
            case 10:
            {
            } break;

            case 11:
            {
                client.NewInfoWidnow("Wrong nick");
            } break;

            case 20:
            {
                client.EndGame();
            } break;

            case 30:
            {
            } break;

            case 40:
            {
                timermessage        = TM_STILL_HERE;
                client.opponentnick = mess.Substring(4, 10);
                client.setLabelVisible(client.OpponentSearchLabel, false);
                PreaperMessageCG(10);
            } break;

            case 41:
            {
                client.OpponentSearchInc();
                timermessage = TM_GIVE_OPP;
            } break;

            default:
            {
                client.NewInfoWidnow("Unknown server message");
            } break;
            }
        }