C# in Depth

Cover of C# in Depth
Order now (3rd edition)

The button is missing in action!

Chapter 13: Minor changes to simplify code (C# 4): P400, section 13.3.4

Created: 10/25/2016
Last updated: 10/25/2016
Severity: Typo

The second paragraph below listing 13.15 contains this text:

The TInput parameter is only used in an input position, so it makes sense that you can use it contravariantly, using a Converter<object, string> as a Converter<Button, string>. In other words, if you can pass any object reference into the converter, you can certainly hand it a Button reference.

The listing never deals with buttons at all - only strings. The paragraph should read:

The TInput parameter is only used in an input position, so it makes sense that you can use it contravariantly, using a Converter<object, string> as a Converter<string, string>. In other words, if you can pass any object reference into the converter, you can certainly hand it a string reference.

(Alternatively, imagine the relevant changes in listing 13.15 to use buttons instead... there's nothing special about strings here.)