Tuesday, June 29, 2010

Event Vs Delegate

Event:
An event is a message sent by an object to signal the occurrence of an action. The object that raises the event is called the event sender. The object that captures the event and responds to it is called the event receiver. In event communication, the event sender class does not know which object or method will receive (handle) the events it raises. What is needed is an intermediary (or pointer-like mechanism) between the source and the receiver. The .NET Framework defines a special type (Delegate) that provides the functionality of a function pointer.

Delegate:
A delegate is a class that can hold a reference to a method.
A delegate class has a signature, and it can hold references only to methods that match its signature. Thus equivalent to a type-safe function pointer or a callback.

Sample Code Download : Event-Delegate-Learn.zip


No comments:

Image Understanding (IU)

Throughout these years, the growth of digital media collections has been accelerating, particularly in still images. These artifacts repre...