Monday, 29 October 2012

C# - Events & Indexers

Advertisement


In C# events are a special type of delegate. An event member of a class provides notifications from user or machine input. A class defines an event by providing an event declaration, which is of type delegate.
The following line shows the definition of an event handler:

public delegate void EventHandler(object sender, System.EventArgs e);

The EventHandler takes two arguments: one of type object and the other of type System.EvenArgs. A class implements the event handler using the event keyword.

LEARN MORE>>>


EmoticonEmoticon