Exemple #1
0
        static void Main(string[] args)
        {
            Incrementer incrememter = new Incrementer();

            Dozens dozensCounter = new Dozens(incrememter);

            incrememter.DoCount();

            Console.WriteLine("Number of dozens = {0}", dozensCounter.DozensCount);
        }
Exemple #2
0
 public Dozens(Incrementer incrementer)
 {
     DozensCount = 0;
     incrementer.CountedADozen += IncremenDozensCount;
 }