February 2007 Entries

Generic EventHandler a new way of handling events

I was surprised to see the syntax of the new Generic Eventhandler... Using the .net 1.1 way we can declare events using the following steps.. STEP 1: declare a delegate public delegate void DivThreeHandler(object ,DivByThreeEventArgs e); The abobe delegate declares the parameters to be sent to the event handlers.Any class that wants to handle this event needs to have a method that mathces this signature. STEP 2: define the EventArgs derived class public class DivByThreeEventArgs:EvetArgs{ ...........code.......}...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati