Delegates :
 
1.They are like function pointers.
2. They are .Net objects which points to an event handler that matches its specific signature. Delegates add a safety dimension in handling function pointers in .Net.
3. They are type safe , object oriented , secure.They can be used to invoke methods of matching signature.
4. It is very much necessary to make sure that the functions which the delegates points has the same number of argument type and same return type.
 
Types of delegates
a) Single Case delegate. Name space used is System.Delegate.
b) MultiCast Delegate : Name space used is System.Multicast Delegate
 
A delegate is called single cast delegate if it invokes a single method. In other words we can say that single cast delegates refer to a single method with matching signature.
 
Muticast delegate : They are nothing but a single cast delegate that can invoke multiple methods of matching signature.It derives from System.MutiCast Delegate class which is a sub class of System.Delegate.
 
Will add one more post of examples in this case.
 

Advertisements