private void playAgain_Click(object sender, RoutedEventArgs e) { AwaleGameWindo awaleGameWindo = new AwaleGameWindo(); App.Current.MainWindow = awaleGameWindo; awaleGameWindo.Show(); }
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(); }
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(); }
//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(); * * }); * * }*/ }