Exemplo n.º 1
0
 public void Add(int x)
 {
     total += x;
     if (total >= threshold)
     {
         ThresholdReachedEventArgs args = new ThresholdReachedEventArgs();
         args.Threshold   = threshold;
         args.TimeReached = DateTime.Now;
         OnThresholdReached(args);
     }
 }
Exemplo n.º 2
0
 private void C_ThresholdReached(object sender, ThresholdReachedEventArgs e)
 {
     textBox1.Text = String.Format("The threshold of {0} was reached at {1}.", e.Threshold, e.TimeReached);
 }