ch 14 changes after pull request
MODIFY
src/Chapter14/Listing14.08.UsingThePlusAndMinusDelegateOperators.cs
src/Chapter14/Listing14.08.UsingThePlusAndMinusDelegateOperators.cs
using System;
using Listing14_01;
using Listing14_05;
- #region INCLUDE
- #region EXCLUDE
public class Program
{
public static void Main()
{
- #endregion EXCLUDE
+ #region INCLUDE
+ //...
Thermostat thermostat = new Thermostat();
Heater heater = new Heater(60);
Cooler cooler = new Cooler(80);
delegate3 = (delegate3 - delegate2)!;
#endregion HIGHLIGHT
delegate3(60);
- #region EXCLUDE
+ //...
+ #endregion INCLUDE
}
}
- #endregion EXCLUDE
- #endregion INCLUDE
}
\ No newline at end of file

MODIFY
src/Chapter14/Listing14.09.OnTemperatureChangedThrowingAnException.cs
src/Chapter14/Listing14.09.OnTemperatureChangedThrowingAnException.cs
string? temperature = Console.ReadLine();
if (!int.TryParse(temperature, out int currentTemperature))
{
- Console.WriteLine
- ($"'{temperature}' is not a valid integer.");
+ Console.WriteLine($"'{temperature}'" +
+ $" is not a valid integer.");
return;
}
thermostat.CurrentTemperature = currentTemperature;
}
}
- #endregion HIGHLIGHT
+ #endregion INCLUDE
}
\ No newline at end of file

MODIFY
src/Chapter14/Listing14.10.HandlingExceptionsFromSubscribers.cs
src/Chapter14/Listing14.10.HandlingExceptionsFromSubscribers.cs
if(value != CurrentTemperature)
{
_CurrentTemperature = value;
- Action<float>?
- onTemperatureChange = OnTemperatureChange;
+ Action<float>? onTemperatureChange
+ = OnTemperatureChange;
if (onTemperatureChange != null)
{
#region HIGHLIGHT

MODIFY
src/Chapter14/Listing14.11.UsingTheAssignmentOperationRatherThanPlusEquals.cs
src/Chapter14/Listing14.11.UsingTheAssignmentOperationRatherThanPlusEquals.cs
@@ -27,8 +27,8 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter14.Listing14_11
string? temperature = Console.ReadLine();
if (!int.TryParse(temperature, out int currentTemperature))
{
- Console.WriteLine
- ($"'{temperature}' is not a valid integer.");
+ Console.WriteLine($"'{temperature}' " +
+ $"is not a valid integer.");
return;
}
thermostat.CurrentTemperature = currentTemperature;

ch 14 changes after pull request