示例#1
0
        private void BeginOK()
        {
            View.Fm_Dialog fm;
            List <String>  nameList = GetAllPlayerName();

            this.Invoke((Action) delegate
            {
                KillTheThread();


                fm = new View.Fm_Dialog(this.Location, String.Format(Properties._string.GameWillBegin), false);
                fm.Show();

                Task.Factory.StartNew(() => { System.Threading.Thread.Sleep(1000); }).ContinueWith(_ =>
                {
                    Thread.Sleep(2000);
                    this.Hide();
                    this.Close();
                    this.Enabled = true;
                    fm.Hide();
                    fm.Close();
                }, TaskScheduler.FromCurrentSynchronizationContext());
            });
            clientLobby.ClientReadyBegin();
            GameControllerMulti.newGame(nameList.Count(), nameList, clientLobby, port);
        }
示例#2
0
 private void BeginNoOk()
 {
     this.Invoke((Action) delegate
     {
         View.Fm_Dialog fm = new View.Fm_Dialog(this.Location, String.Format(Properties._string.NotEnoughPlayer), true);
         fm.ShowDialog();
         Thread.Sleep(3000);
         fm.Hide();
         fm.Close();
     });
 }