A
delegate is a form of
type-safe function pointer used by the
Common Language Infrastructure (CLI). Delegates specify a
method to call and optionally an
object to call the method on. Delegates are used, among other things, to implement
callbacks and
event listeners. A delegate object encapsulates a reference to a method. The delegate object can then be passed to code which can call the
referenced method, without having to know at compile time which method will be invoked.