Exemple #1
0
        protected virtual void OnThresholdReached(ThresholdReachedArgs args)
        {
            EventHandler <ThresholdReachedArgs> handler = ThresholdReached;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Exemple #2
0
 public void Add(int x)
 {
     total += x;
     if (total >= threshold)
     {
         ThresholdReachedArgs args = new ThresholdReachedArgs();
         args.Threshold   = threshold;
         args.TimeReached = DateTime.Now;
         OnThresholdReached(args);
     }
 }