It's an object which derives from the System.Delegate class and which represents a method and (in the case of an instance method) an object on which to call that method.
The signature of the method must be compatible with that of the delegate itself.
The method can then be invoked via the delegate rather than directly which has certain advantages in some circumstances.
In C# all delegates derive from the System.MulticastDelegate class (a sub-class of System.Delegate) which means that the delegate can represent not one but several compatible methods all of which can be invoked one after the other by invoking the delegate itself.
Delegates are also the foundation of events and anonymous methods and lambda expressions can automatically be converted to compatible delegate types.
VulpesPosted Jul 27, 2012, 6:10 AM
The signature of the method must be compatible with that of the delegate itself.
The method can then be invoked via the delegate rather than directly which has certain advantages in some circumstances.
In C# all delegates derive from the System.MulticastDelegate class (a sub-class of System.Delegate) which means that the delegate can represent not one but several compatible methods all of which can be invoked one after the other by invoking the delegate itself.
Delegates are also the foundation of events and anonymous methods and lambda expressions can automatically be converted to compatible delegate types.