コード例 #1
0
ファイル: GiftControl.cs プロジェクト: sobne/Nkit
 protected void OnBtnClick(GiftArgs e)
 {
     if (this.BtnClick != null)
     {
         this.BtnClick(this, e);
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: sobne/Nkit
        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();
            }
        }