Example #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);
     }
 }
Example #2
0
 static void c_ThresholdReached(object sender, ThresholdReachedEventArgs e)
 {
     Console.WriteLine("The threshold of {0} was reached at {1}.", e.Threshold, e.TimeReached);
     Environment.Exit(0);
 }