Chapter 20. Decoupling application logic and handling events
After completing this chapter, you will be able to:
Create an instance of a delegate to refer to a specific method.
Call a method through a delegate.
Handle an event by using a delegate.
Many of the examples and exercises in this book have placed great emphasis on the careful definition of classes and structures to enforce encapsulation. In this way, the implementation of the methods in these types can change without unduly affecting the applications that use them. However, sometimes it is not always possible or desirable to encapsulate the entire functionality of a type. For example, the logic for a ...
Get Microsoft Visual C# 2013 Step by Step now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.