Covariance and Contravariance in Delegates (C#)
Full Name:
Covariance and Contravariance in Delegates (C#)
Short Name:
Covariance and Contravariance in Delegates (C#)
Type of Entity:
C#
Abstract:
Covariance and contravariance provide a degree of flexibility when matching delegate methods with delegate signatures. Covariance permits a method with a derived return type to be used as the delegate, and contravariance permits a method with derived parameters to be used as the delegate. This ability enables the creation of more flexible delegate methods, able to cope with more than a specific class or event.
MSDN Source URL:
http://msdn2.microsoft.com/ms173174.aspx