Delegates

Delegates are reference types that encapsulate methods. Delegates are used as container objects that encapsulate or hide the referenced methods. This is done so that the client code that uses a delegate is restricted from accessing any important information that might be contained in the method.

→ To learn more about objects, seeObjects,” p. 89

There are two kinds of methods, static and instance. A static method is a method that is associated with a class. An instance method is a method that is associated with an instance of a class. Delegates support both static and instance methods. This is because delegates are not affected by the type of objects they encapsulate. Delegates only check to ensure that the signature of the method ...

Get Special Edition Using C# 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.