O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

This chapter discussed delegates and events and their importance for implementing event driven programs in C#. The important points mentioned in this chapter are as follows.

A delegate is a subclass of System.Delegate. It specifies the return and parameter types for the methods it can encapsulate. When a delegate is called, it delegates this call to the method implementation of the method is encapsulates.

Delegates let us postpone method implementation decisions until runtime. For example, arrays of delegates let us decide on sequences of operations during runtime, and method implementations can be passed around as arguments to methods.

A multicast delegate can encapsulate more than one method. Any delegate with the return type void

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required