Exemplo n.º 1
0
        public void Add(int value)
        {
            _total += value;

            if (_total < _threshold)
            {
                return;
            }

            ThresholdReachedEventArgs args = new ThresholdReachedEventArgs
            {
                Threshold   = _total,
                ReachedTime = DateTime.Now
            };

            OnThresholdReached(args);
        }
Exemplo n.º 2
0
 private void OnThresholdReached(ThresholdReachedEventArgs args)
 {
     ThresholdReached?.Invoke(this, args);
 }
Exemplo n.º 3
0
 private static void OnThresholdReached(object sender, ThresholdReachedEventArgs e)
 {
     Console.WriteLine($"The threshold of {e.Threshold} was reached at {e.ReachedTime}");
     _thresholdNotReached = false;
 }