File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,24 @@ Page 190, the event name should be `NewCarCreated` instead of `NewCarInfo`:
44
44
45
45
Thanks to [ @DanielNikoofar ] ( https://github.com/DanielNikoofar ) for reporting this issue!
46
46
47
+ Page 191, the method should be ` CreateANewCar ` instead of ` NewCar() ` , and the event ` NewCarCreated ` instead of ` NewCarInfo ` (also see page 190).
48
+
49
+ ``` csharp
50
+ CarDealer dealer = new ();
51
+ Consumer sebastian = new (" Sebastian" );
52
+ dealer .NewCarCreated += sebastian .NewCarIsHere ;
53
+ dealer .CreateANewCar (" Williams" );
54
+ Consumer max = new (" Max" );
55
+ dealer .NewCarCreated += max .NewCarIsHere ;
56
+ dealer .CreateANewCar (" Aston Martin" );
57
+ dealer .NewCarCreated -= sebastian .NewCarIsHere ;
58
+ dealer .CreateANewCar (" Ferrari" );
59
+ ```
60
+
61
+ [ See source code - EventsSample/Program.cs] ( https://github.com/ProfessionalCSharp/ProfessionalCSharp2021/blob/main/1_CS/Delegates/EventsSample/Program.cs )
62
+
63
+ Thanks to [ @zpfdev ] ( https://github.com/zpfdev ) ) for reporting this issue!
64
+
47
65
## Chapter 11, Tasks and Asynchronous Programming
48
66
49
67
Page 296 shows this source code:
You can’t perform that action at this time.
0 commit comments