예제 #1
0
        private void playAgain_Click(object sender, RoutedEventArgs e)
        {
            AwaleGameWindo awaleGameWindo = new AwaleGameWindo();

            App.Current.MainWindow = awaleGameWindo;
            awaleGameWindo.Show();
        }
예제 #2
0
        private void StartGame_Click(object sender, RoutedEventArgs e)
        {
            //MessageBox.Show(this.pseudo1.Text);
            this.awaleGame.awale.Joueurs.Add(new Joueur(this.pseudo1.Text));
            this.awaleGame.awale.Joueurs.Add(new Joueur(this.pseudo2.Text));

            AwaleGameWindo awaleGameWindo = new AwaleGameWindo();

            App.Current.MainWindow = awaleGameWindo;
            this.Close();
            awaleGameWindo.Show();
        }
예제 #3
0
        private void backgroundWorker4_DoWork(object sender, DoWorkEventArgs e)
        {
            if (client.Connected)
            {
                STW.WriteLine(this.ready);
                Application.Current.Dispatcher.Invoke((Action) delegate {
                    AwaleGameWindo awaleGameWindo = new AwaleGameWindo();
                    App.Current.MainWindow        = awaleGameWindo;
                    awaleGameWindo.Show();
                    this.Close();
                    //MessageBox.Show(this.receiveTextBox.ToString());
                });
            }

            backgroundWorker4.CancelAsync();
        }
예제 #4
0
        //lancer le jeu ...Plateau
        private void backgroundWorker3_DoWork(object sender, DoWorkEventArgs e)
        {
            while (client.Connected)
            {
                try
                {
                    receive = STR.ReadLine();

                    if (receive != "true")
                    {
                        Application.Current.Dispatcher.Invoke((Action) delegate {
                            AwaleGameWindo awaleGameWindo = new AwaleGameWindo();
                            App.Current.MainWindow        = awaleGameWindo;
                            awaleGameWindo.Show();
                            this.Close();
                            //MessageBox.Show(this.receiveTextBox.ToString());
                        });
                    }

                    receive = "";
                }
                catch (Exception x)
                {
                    MessageBox.Show(x.Message.ToString());
                }
            }

            /* if (client.Connected)
             * {
             *   Application.Current.Dispatcher.Invoke((Action)delegate {
             *
             *       AwaleGameWindo awaleGameWindo = new AwaleGameWindo();
             *       App.Current.MainWindow = awaleGameWindo;
             *       awaleGameWindo.Show();
             *       this.Close();
             *
             *   });
             *
             * }*/
        }