Esempio n. 1
0
        /// <summary>
        /// The Add.
        /// </summary>
        /// <param name="x">The x<see cref="int"/>.</param>
        public void Add(int x)
        {
            count += x;   // Add to the count

            // Create an instance of the ThresholdReachedEventArgs class
            ThresholdReachedEventArgs args = new ThresholdReachedEventArgs();

            args.Threshold = count;
            // Triger the event
            OnThresholdReached(args);
        }
Esempio n. 2
0
 /// <summary>
 /// Handel the ThresholdReached of totalCount, totalCount_ThresholdReached.
 /// </summary>
 /// <param name="sender">The sender<see cref="Object"/>.</param>
 /// <param name="e">The e<see cref="ThresholdReachedEventArgs"/>.</param>
 private void totalCount_ThresholdReached(Object sender, ThresholdReachedEventArgs e)
 {
     textBoxDid.Text = "The threshold of " + e.Threshold + " was reached at " + e.TimeReached + ".";
 }