private void JoinGame_Click(object sender, RoutedEventArgs e) { joinGameDialog = new JoinGameDialog(); joinGameDialog.Find.Click += Find_Click; joinGameDialog.Confirm.Click += Confirm_Click_join; joinGameDialog.Quit.Click += Quit_Click; joinGameDialog.Closed += (object a, EventArgs b) => { try { networkcontrol.JoinGame_thread.Abort(); networkcontrol.LinkServer_thread.Abort(); } catch (Exception ex) { }; }; joinGameDialog.Owner = this; joinGameDialog.ShowDialog(); }
private void JoinGame_Click( object sender, RoutedEventArgs e ) { joinGameDialog = new JoinGameDialog(); joinGameDialog.Find.Click += Find_Click; joinGameDialog.Confirm.Click += Confirm_Click_join; joinGameDialog.Quit.Click += Quit_Click; joinGameDialog.Closed += ( object a, EventArgs b ) => { try { networkcontrol.JoinGame_thread.Abort(); networkcontrol.LinkServer_thread.Abort(); } catch ( Exception ex ) { }; }; joinGameDialog.Owner = this; joinGameDialog.ShowDialog(); }