コード例 #1
0
        static void Main(string[] args)
        {
            EventGenerator generator = new EventGenerator();

            generator.GeneratorEvent += new EventHandler(generator_GeneratorEvent);
            generator.StartGenerate();
            Console.ReadLine();
        }
コード例 #2
0
        static void generator_GeneratorEvent(object sender, EventArgs e)
        {
            EventGenerator g = sender as EventGenerator;

            if (g != null & g.GenerationCount == 0)
            {
                g.GenerationCount = EVENTCOUNTER;
            }
            Console.WriteLine("Got Event!");
        }