■
Source Code
The AnonymousMethods project is located under the Chapter 11 subdirectory.
Understanding Method Group Conversions
Another delegate-and-event-centric feature of C# is termed method group conversion. This feature
allows you to register the “simple” name of an event handler (in fact, you may have noticed that this
syntax was actually used earlier in this chapter during the GenericDelegate example). To illustrate,
let’s revisit the SimpleMath type examined earlier in this chapter, which is now updated with a new
event named ComputationFinished:
public class SimpleMath
{
Do'stlaringiz bilan baham: |