private void btnInvite_Click(object sender, RoutedEventArgs e) { object o = PopUpInviteAlliance.ShowPopUp(this.Alliance.Alliance); if (o != null) { List <Airline> airlines = (List <Airline>)o; foreach (Airline airline in airlines) { if (AIHelpers.DoAcceptAllianceInvitation(airline, this.Alliance.Alliance)) { WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2605"), string.Format(Translator.GetInstance().GetString("MessageBox", "2605", "message"), airline.Profile.Name, this.Alliance.Alliance.Name), WPFMessageBoxButtons.Ok); this.Alliance.addMember(new AllianceMember(airline, GameObject.GetInstance().GameTime)); } else { WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2606"), string.Format(Translator.GetInstance().GetString("MessageBox", "2606", "message"), airline.Profile.Name, this.Alliance.Alliance.Name), WPFMessageBoxButtons.Ok); } } } }
public static object ShowPopUp(Alliance alliance) { PopUpWindow window = new PopUpInviteAlliance(alliance); window.ShowDialog(); return window.Selected; }