public ChallengeForm(User target) { this.InitializeComponent(); this._targetInfo = target; this._challengeInfo = new PokemonBattle.BattleRoom.Client.ChallengeInfo(); this._challengeInfo.Rules = new BattleRuleSequence(); this._myChallenge = true; this.OK_Button.Text = "确定(&O)"; this.Cancel_Button.Text = "取消(&A)"; this.NameLabel.Text = string.Format("对象 : {0}", this._targetInfo.Name); this.CustomLabel.Text = string.Format("自定数据 : {0}", this._targetInfo.CustomDataInfo); this.ModeCombo.SelectedIndex = 0; this.LinkCombo.SelectedIndex = 0; this.Cancel_Button.Click += new EventHandler(this.Cancel_Button_Click); }
public ChallengeForm(User from, PokemonBattle.BattleRoom.Client.ChallengeInfo challenge) { this.InitializeComponent(); this._targetInfo = from; this._challengeInfo = challenge; this._myChallenge = false; this.LinkCombo.Enabled = false; switch (challenge.LinkMode) { case BattleLinkMode.Agent: this.LinkCombo.SelectedIndex = 1; break; case BattleLinkMode.Direct: this.LinkCombo.SelectedIndex = 0; break; } this.ModeCombo.Enabled = false; BattleMode battleMode = challenge.BattleMode; if (battleMode == BattleMode.Single) { this.ModeCombo.SelectedIndex = 0; } else if (battleMode == BattleMode.Double) { this.ModeCombo.SelectedIndex = 1; } this.PPUpCheck.Enabled = false; if (challenge.Rules.Elements.Contains(BattleRule.PPUp)) { this.PPUpCheck.Checked = true; } this.RandomCheck.Enabled = false; if (challenge.Rules.Elements.Contains(BattleRule.Random)) { this.RandomCheck.Checked = true; } this.OK_Button.Text = "接受(&A)"; this.Cancel_Button.Text = "拒绝(&R)"; this.NameLabel.Text = string.Format("来自 : {0}", this._targetInfo.Name); this.CustomLabel.Text = string.Format("自定数据 : {0}", this._targetInfo.CustomDataInfo); }