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

Chapter 20. DELEGATES AND EVENTS

You will learn about the following in this chapter:

  • What a delegate is

  • Defining and instantiating delegates

  • Using delegates as arguments to method calls and creating arrays of delegates

  • Multicast delegates and why they are useful for implementing event-driven programs

  • What an event is and how it can be implemented with a delegate

  • The basic architecture of a typical event-driven program

Recall from Chapter 17, “Inheritance Part II: abstract Functions, Polymorphism, and Interfaces” how inheritance enabled us to reference objects of different subclasses (such as Circle, Rectangle and Triangle) with the same variable of a common ancestor class (such as Shape). Through dynamic binding (by calling DrawYourself in Shape

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