O'Reilly logo

CLR via C#, 3rd Edition by Jeffrey Richter

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 17. Delegates

In this chapter:

A First Look at Delegates 405

Using Delegates to Call Back Static Methods 408

Using Delegates to Call Back Instance Methods 409

Demystifying Delegates 410

Using Delegates to Call Back Many Methods (Chaining) 415

Enough with the Delegate Definitions Already (Generic Delegates) 422

C#'s Syntactical Sugar for Delegates 423

Delegates and Reflection 431

In this chapter, I talk about callback functions. Callback functions are an extremely useful programming mechanism that has been around for years. The Microsoft .NET Framework exposes a callback function mechanism by using delegates. Unlike callback mechanisms used in other platforms, such as unmanaged C++, delegates offer much more functionality. For example, ...

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