private void hlCodeSharing_Click(object sender, RoutedEventArgs e) { object o = PopUpCodeshareAgreement.ShowPopUp(this.Airline.Airline); if (o != null) { CodeshareAgreement.CodeshareType type = (CodeshareAgreement.CodeshareType)o; Boolean accepted = AirlineHelpers.AcceptCodesharing(this.Airline.Airline, GameObject.GetInstance().HumanAirline, type); if (accepted) { this.HasCodesharing = true; this.ShowActionMenu = !this.Airline.Airline.IsHuman && (this.CanHaveAlliance || !this.HasCodesharing); CodeshareAgreement agreement = new CodeshareAgreement(this.Airline.Airline, GameObject.GetInstance().HumanAirline, type); this.Airline.addCodeshareAgreement(agreement); GameObject.GetInstance().HumanAirline.addCodeshareAgreement(agreement); } else { WPFMessageBox.Show(Translator.GetInstance().GetString("MessageBox", "2408"), string.Format(Translator.GetInstance().GetString("MessageBox", "2408", "message"), this.Airline.Airline.Profile.Name), WPFMessageBoxButtons.Ok); } } }
//adds a codeshare agreement public void addCodeshareAgreement(CodeshareAgreement share) { this.Codeshares.Add(share.Airline1 == this.Airline ? share.Airline2 : share.Airline1); this.Airline.addCodeshareAgreement(share); this.HasAlliance = this.Alliance != null || this.Codeshares.Count > 0; }
public CodeshareAgreementMVVM(CodeshareAgreement agreement) { this.Agreement = agreement; }