static void Main(string[] args)
        {
            Counter c = new Counter(new Random().Next(10));
            c.ThresholdReached += c_ThresholdReached;

            Console.WriteLine("Press 'a' key to increase total");
            while(Console.ReadKey(true).KeyChar == 'a')
            {
                Console.WriteLine("Adding One");
                c.Add(1);
            }
        }
Example #2
0
 public static void Decrement(this Counter c)
 {
     c.Count--;
 }