protected void OnBtnClick(GiftArgs e) { if (this.BtnClick != null) { this.BtnClick(this, e); } }
public void giftBox_BtnClick(object sender, GiftArgs e) { if (!bChose) { return; } if (LotteryRuntime.Instance.CurrentGiftId == e.Gift.Id) { return; } LotteryRuntime.Instance.IsAdd = false; LotteryRuntime.Instance.SetCurrentGift(e.Gift.Id); currentgiftcount = LotteryRuntime.Instance.CurrentGiftCount; luckersofgift.Clear(); if (LotteryRuntime.Instance.HasGiftAndLuckerRemain()) { button.Enabled = true; button1.Visible = false; comboBox1.Visible = false; AddCtl(null); } else { var cur_winners = winners?.Where(x => x.Gift.Id.Equals(e.Gift.Id)); if (cur_winners != null && cur_winners.Any()) { foreach (var item in cur_winners) { luckersofgift.Add(item.Chooser); } AddCtl(luckersofgift); } giftControl.SetBtnForeColor(LotteryRuntime.Instance.CurrentGiftId); DisableButton(); } }