Пример #1
0
        public void DoCount()
        {
            IncrementerEventArgs args = new IncrementerEventArgs();

            for (int i = 1; i < 100; i++)
            {
                if (i % 12 == 0 && CountedADozen != null)
                {
                    args.IterationCount = i;
                    // Raise the event
                    CountedADozen(this, args);
                }
            }
        }
Пример #2
0
        void IncremenDozensCount(object source, IncrementerEventArgs e)
        {
            Console.WriteLine("Incremented at iteration: {0} in {1}", e.IterationCount, source.ToString());

            DozensCount++;
        }