Esempio n. 1
0
        private void btn_number_click(object sender, EventArgs e)
        {
            var button = (KryptonButton)sender;

            if (button.Text.Contains("D"))
            {
                if (txtbox_diceRoller.Text == null || txtbox_diceRoller.Text == "")
                {
                    txtbox_diceRoller.Text = "1";
                }
                if (txtbox_diceRoller.Lines.Any())
                {
                    txtbox_diceRoller.Text += roller.DButtonMethod(txtbox_diceRoller.Lines[txtbox_diceRoller.Lines.Length - 1], button.Text.Substring(button.Text.IndexOf('D') + 1));
                }
                else
                {
                    txtbox_diceRoller.Text += roller.DButtonMethod(txtbox_diceRoller.Text, button.Text.Substring(button.Text.IndexOf('D') + 1));
                }
            }
            else
            {
                txtbox_diceRoller.Text += button.Text;
            }
        }