Method Groups

Closely related to method overloads are method groups, which are typically used with delegates, as you will see later in Chapter 17, “Delegates.” Basically, a method group is a set of overloaded methods that’s classified as an expression and is created by using a member lookup operation. For example, the following are method groups:

Console.WriteLinename.Substring

In a nutshell, delegates are a means to refer to a method such that it can be passed along as an object. For example, one piece of code might need “a method that will be able to take an object and return a Boolean to indicate whether it passes a condition.” To express this, it can take in a delegate that basically captures the signature of such a helper method it needs ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.