public void Add(int x) { total += x; //Console.WriteLine("Adding {0}", this.total); if (total >= threshold) { ThresholdReachedEventArgs args = new ThresholdReachedEventArgs(); args.Threshold = threshold; args.TimeReached = DateTime.Now; //Console.Write("REACHED"); OnThresholdReached(args); } }
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); }