Delegates and Events in C#

Delegates in C#

Another very interesting feature in C# is delegates. Delegates are best complemented as new type of Object in C#. They are also represented as pointer to functions. Technically Delegates are reference types which allow indirect calls to methods.   A delegate instance holds references to some number of methods, and by invoking the delegate one …

Delegates in C# Read More »

Events In C#

A C# event is a class member that is activated whenever the event it was designed for occurs. I like to use the term “fires” when the event is activated. Anyone interested in the event can register and be notified as soon as the event fires. At the time an event fires, registered methods will …

Events In C# Read More »

Event Handlers in C#

An event handler in C# is a delegate with a special signature, given below:   public delegate void MyEventHandler(object sender, MyEventArgs e);   In the above declaration, the first parameter (sender) in the above declaration specifies the object that fired the event. and the second parameter (e) holds the data that can be used in …

Event Handlers in C# Read More »

Scroll to Top