Chapter 13. Delegates and Events
Previous chapters discussed extensively how to create classes using many of the built-in C# language facilities surrounding classes. The objects instantiated from classes encapsulate data and operations on da...
Method Pointers
Veteran C and C++ programmers have long used method pointers as a means to pass executable steps as parameters to another method. C# achieves the same functionality using a delegate, which encapsulates methods as objects, enabling ...
Multicast Delegates and the Observer Pattern
In this chapter, you've seen how to store a single method inside an instance of a delegate type and invoke that method via the delegate. Delegates are more than storage mechanisms for a single method,...
Events
There are two key problems with the delegates as you have used them so far. To overcome these issues, C# uses the keyword event. In this section, you will see why you would use events, and how they work.
Why Events?
This chapter has cov...
Summary
This chapter began with a discussion of delegates and their use as method pointers and callbacks. Next, it discussed the full potential of a delegate within the observer pattern. Now that you have described events, it is worth mentioning t...
С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.