Пример #1
0
 private void button8_Click(object sender, EventArgs e)
 {
     currentBet.Enabled = false;
     bet = null;
     newBet.Enabled = true;
 }
Пример #2
0
 private void betStart_Click(object sender, EventArgs e)
 {
     if (!checkString(betOptionA.Text, "Please enter a valid option A.")) { }
     else if (!checkString(betName.Text, "Please enter a valid name.")) { }
     else if (!checkString(betAnnoucementInterval.Text, "Please enter a valid duration.")) { }
     else if (!checkString(betOptionB.Text, "Please enter a valid option B.")) { }
     else if (!checkInt(betMaxAmount.Text, "Please enter a valid amount.")) { }
     else if (!checkInt(betMaxEntry.Text, "Please enter a valid max entry times.")) { }
     else if (!checkInt(betDuration.Text, "Please enter a valid duration.")) { }
     else
     {
         newBet.Enabled = false;
         bet = new Bet(betName.Text,
             betOptionA.Text,
             betOptionB.Text,
             Convert.ToInt16(betMaxAmount.Text),
             Convert.ToInt32(betDuration.Text) + UnixTimeNow(),
             Convert.ToInt32(betAnnoucementInterval.Text),
             Convert.ToInt16(betMaxEntry.Text)
         );
         connection.Sender.PublicMessage("#" + this.channelBox.Text, "Betting is open: " + bet.name + " !bet a: " + bet.optionA + " !bet b: " + bet.optionB + ". Max. betsize is: " + bet.maxBet + ". To bet, type: !bet a <amount>  or !bet b <amount>.");
     }
 }
Пример #3
0
 private void button7_Click_1(object sender, EventArgs e)
 {
     currentBet.Enabled = false;
     Thread t = new Thread(() =>
     {
         this.members = bet.refund(members);
         bet = null;
         this.Invoke(new Action(() => newBet.Enabled = true));
     });
     t.Start();
 }
Пример #4
0
 private void betButtonOptionB_Click(object sender, EventArgs e)
 {
     currentBet.Enabled = false;
     Thread t = new Thread(() =>
     {
         this.members = bet.settleBet(false, this.members);
         bet = null;
         this.Invoke(new Action(() => newBet.Enabled = true));
     });
     t.Start();
 }