Exemplo n.º 1
0
        private void buttonNumber_Click(object sender, EventArgs e)
        {
            Button btnSender = sender as Button;

            Number += btnSender.Text;

            OnNumberChanged?.Invoke(this, new SimpleEventArgs(Number));
        }
Exemplo n.º 2
0
 void BtnPlus_Click(object sender, EventArgs e)
 {
     if (CurrentValue < MaxValue)
     {
         CurrentValue++;
         txtValue.Text = CurrentValue.ToString();
         OnNumberChanged?.Invoke(CurrentValue);
     }
 }
Exemplo n.º 3
0
 void BtnMinus_Click(object sender, EventArgs e)
 {
     if (CurrentValue > MinValue)
     {
         CurrentValue--;
         txtValue.Text = CurrentValue.ToString();
         OnNumberChanged?.Invoke(CurrentValue);
     }
 }
Exemplo n.º 4
0
 //Triggers an event which will regenerated a random number each time the event elapsed.
 private void OnTick(object sender, ElapsedEventArgs E)
 {
     OnNumberChanged?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 5
0
 private void btnCC_Click(object sender, EventArgs e)
 {
     Number = string.Empty;
     OnNumberChanged?.Invoke(this, new SimpleEventArgs(Number));
 }