ch. 17 changes after pdf review
MODIFY
src/Chapter17/Listing17.05.AddingItemsToADictionary.cs
src/Chapter17/Listing17.05.AddingItemsToADictionary.cs
@@ -9,8 +9,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter17.Listing17_05
public static void Main()
{
// C# 6.0 (use {"Error", consoleColor.Red} pre-C# 6.0)
- Dictionary<string, ConsoleColor> colorMap =
- new Dictionary<string, ConsoleColor>
+ var colorMap = new Dictionary<string, ConsoleColor>
{
["Error"] = ConsoleColor.Red,
["Warning"] = ConsoleColor.Yellow,

MODIFY
src/Chapter17/Listing17.14.UsingYieldToImplementBinaryTree.cs
src/Chapter17/Listing17.14.UsingYieldToImplementBinaryTree.cs
@@ -10,8 +10,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter17.Listing17_14
IEnumerable<T>
#endregion HIGHLIGHT
{
- public Pair(T first, T second)
- : this()
+ public Pair(T first, T second) : this()
{
First = first;
Second = second;
@@ -48,7 +47,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter17.Listing17_14
yield return Second;
}
#endregion IEnumerable<T>
+ #endregion HIGHLIGHT
+ #region HIGHLIGHT
#region IEnumerable Members
System.Collections.IEnumerator
System.Collections.IEnumerable.GetEnumerator()

MODIFY
src/Chapter17/Listing17.20.UsingYieldReturnInAMethodThatReturnsIEnumberable.cs
src/Chapter17/Listing17.20.UsingYieldReturnInAMethodThatReturnsIEnumberable.cs
@@ -40,7 +40,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter17.Listing17_20
//Listing 16.20 Using yield return in a Method That Returns IEnumerable<T>
#endregion EXCLUDE
+ #region HIGHLIGHT
public IEnumerable<T> GetReverseEnumerator()
+ #endregion HIGHLIGHT
{
yield return Second;
yield return First;
@@ -68,7 +70,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter17.Listing17_20
public static void Main()
{
var game = new Pair<string>("Redskins", "Eagles");
+ #region HIGHLIGHT
foreach (string name in game.GetReverseEnumerator())
+ #endregion HIGHLIGHT
{
Console.WriteLine(name);
}

ch. 17 changes after pdf review