Exemplo n.º 1
0
        public void Add(int value)
        {
            total += value;
            if (total >= THRESHOLD)
            {
                //
                var args = new ThresholdReachedEventArgs();
                args.Threshold   = THRESHOLD;
                args.TimeReached = DateTime.Now;

                ThresholdReached?.Invoke(this, args);
            }
        }
Exemplo n.º 2
0
 static void c_ThresholdReached(object sender, ThresholdReachedEventArgs e)
 {
     Console.WriteLine("The threshold was reached");
     Console.WriteLine($"Threshold: {e.Threshold}");
     Console.WriteLine($"TimeReached: {e.TimeReached}");
 }