/// <summary> /// The delegate that the counter calls when it has reached its threshold /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private static void CounterOnThresholdReached(object sender, ThresholdReachedEventArgs args) { Console.WriteLine($"Counter has reached its threshold. Threshold = {args.Threshold}, Total Count = {args.TotalCount} "); }
/// <summary> /// Publish the ThresholdReached event when the threshold has been reached /// </summary> /// <param name="args"></param> private void PublishThresholdReachedEvent(ThresholdReachedEventArgs args) { ThresholdReached?.Invoke(this, args); }