This documentation is archived and is not being maintained.

Callback Function Usage

.NET Framework 1.1

Delegates, Interfaces and Events allow you to provide callback functionality. Each type has its own specific usage characteristics that make it better suited to particular situations.


Use an event if the following are true:

  • A method signs up for the callback function up front, typically through separate Add and Remove methods.
  • Typically, more than one object will want notification of the event.
  • You want end users to be able to easily add a listener to the notification in the visual designer.


Use a delegate if the following are true:

  • You want a C language style function pointer.
  • You want a single callback function.
  • You want registration to occur in the call or at construction time, not through a separate Add method.


Use an interface if the callback function requires complex behavior.

See Also

Design Guidelines for Class Library Developers