Information Technology Reference
In-Depth Information
Figure 15-11. Comparing a named method and an anonymous method
Both sets of code in Figure 15-11 produce the following output:
25
26
Using Anonymous Methods
You can use an anonymous method in the following places:
￿
As an initializer expression when declaring a delegate variable.
￿
On the right-hand side of an assignment statement when combining delegates.
￿
On the right-hand side of an assignment statement adding a delegate to an event.
Chapter 16 covers events.
Search WWH ::




Custom Search