junwei's profileRichard's footprint on ....PhotosBlogListsMore ![]() | Help |
|
August 04 dev skill lesson plansC# dev skill lesson plans for the next 2 weeks.
1. anonymous method & delegate
2. LINQ
3. lamda expression
4. extension method
5. query expression
this time, focus on anonymous method & delegate.
delegate
1. delegate's signature consists of parameters and return type.
2. each method which matches delegate's signature can be assigned to the delegate.
3. covariance allows delegate defining a general return type and one method which has matched the signature and more derived return type can be assigned to it, yet contravariance allows defining a general parameter type when declaring delegate.
4.generic delegate can be used with typical design patterns
anonymous method
1. essentially a way pass code block as delegate parameter, reducing the unnecessary overhead. |
|
|