Resequenced to Ch 20 to match manuscript
RENAME
src/Chapter20.Tests/Listing20.05.AsynchronousStreams.Tests.cs
src/Chapter20.Tests/Listing20.08.SignaturesOfAsyncEnumerableSelectMethods.cs
@@ -7,7 +7,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_05.Tests
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_08
{
[TestClass]
public class AsyncStreamsTests

RENAME
src/Chapter20.Tests/Listing20.08.CatchingExceptionFromAsyncVoidMethod.Tests.cs
src/Chapter20.Tests/Listing20.11.ImplementingCustomAsynchronousMethod.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_08
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_11
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

RENAME
src/Chapter20/Listing20.04B.AwaitStatement.cs
src/Chapter20/Listing20.05.AwaitStatement.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_04B
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_05
{
using System.Threading.Tasks;

RENAME
src/Chapter20/Listing20.05.AsynchronousStreams.cs
src/Chapter20/Listing20.06.AsynchronousStreams.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_05
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_06
{
using System;
using System.IO;

RENAME
src/Chapter20/Listing20.06.AsynchronousStreamsInvocationWithAwaitForeach.cs
src/Chapter20/Listing20.07.AsynchronousStreamsInvocationWithAwaitForeach.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_06
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_07
{
using System;
using System.Collections.Generic;

RENAME
src/Chapter20/Listing20.07.SignaturesOfAsyncEnumerableSelectMethods.cs
src/Chapter20/Listing20.08.SignaturesOfAsyncEnumerableSelectMethods.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_07
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_08
{
}
-namespace System.Linq
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_08
{
public static class AsyncEnumerable
{

RENAME
src/Chapter20/Listing20.08.CatchingExceptionFromAsyncVoidMethod.cs
src/Chapter20/Listing20.09.CatchingExceptionFromAsyncVoidMethod.cs
// Justification: Catching general exception types to demonstrate control flow.
#pragma warning disable CA1031 // Do not catch general exception types
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_08
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_09
{
using System;
using System.Threading;

RENAME
src/Chapter20/Listing20.08B.AsynchronousAsALambda.cs
src/Chapter20/Listing20.10.AsynchronousAsALambda.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_08B
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_10
{
using System;
using System.IO;

RENAME
src/Chapter20/Listing20.09.ImplementingCustomAsynchronousMethod.cs
src/Chapter20/Listing20.11.ImplementingCustomAsynchronousMethod.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_09
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_11
{
using System.Diagnostics;
using System.Threading;

RENAME
src/Chapter20/Listing20.10.CustomMethodWithProgressSupport.cs
src/Chapter20/Listing20.12.CustomMethodWithProgressSupport.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_10
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_12
{
using System;
using System.Diagnostics;

RENAME
src/Chapter20/Listing20.12.CallingTaskContinueWith.cs
src/Chapter20/Listing20.13.CallingTaskContinueWith.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_12
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_13
{
using System;
using System.Threading;

DELETE
src/Chapter20/Listing20.13.SynchronousHighLatencyInvocationInWPF.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_12
-{
- using System;
- using System.Threading;
- using System.Threading.Tasks;
-
- public class Program
- {
- public static void Main()
- {
- DisplayStatus("Before");
- Task taskA =
- Task.Run(() =>
- DisplayStatus("Starting..."))
- .ContinueWith(antecedent =>
- DisplayStatus("Continuing A..."));
- Task taskB = taskA.ContinueWith(antecedent =>
- DisplayStatus("Continuing B..."));
- Task taskC = taskA.ContinueWith(antecedent =>
- DisplayStatus("Continuing C..."));
- Task.WaitAll(taskB, taskC);
- DisplayStatus("Finished!");
- }
-
- private static void DisplayStatus(string message)
- {
- string text =
- $@"{ Thread.CurrentThread.ManagedThreadId
- }: { message }";
-
-
- Console.WriteLine(text);
- }
- }
-}
-
-
-
-
-

ADD
src/Chapter20/Listing20.14.SynchronousHighLatencyInvocationInWPF.cs
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_14
+{
+ public class Program
+ {
+ private void PingButton_Click(
+ object sender, RoutedEventArgs e)
+ {
+ StatusLabel.Content = "Pinging...";
+ UpdateLayout();
+ Ping ping = new Ping();
+ PingReply pingReply =
+ ping.Send("www.IntelliTect.com");
+ StatusLabel.Text = pingReply.Status.ToString();
+ }
+ }
+}
+
+
+
+
+

DELETE
src/Chapter20/Listing20.14.SynchronousHighLatencyInvocationInWPFUsingAwait.cs
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_12
-{
- using System;
- using System.Threading;
- using System.Threading.Tasks;
-
- public class Program
- {
- public static void Main()
- {
- DisplayStatus("Before");
- Task taskA =
- Task.Run(() =>
- DisplayStatus("Starting..."))
- .ContinueWith(antecedent =>
- DisplayStatus("Continuing A..."));
- Task taskB = taskA.ContinueWith(antecedent =>
- DisplayStatus("Continuing B..."));
- Task taskC = taskA.ContinueWith(antecedent =>
- DisplayStatus("Continuing C..."));
- Task.WaitAll(taskB, taskC);
- DisplayStatus("Finished!");
- }
-
- private static void DisplayStatus(string message)
- {
- string text =
- $@"{ Thread.CurrentThread.ManagedThreadId
- }: { message }";
-
-
- Console.WriteLine(text);
- }
- }
-}
-
-
-
-
-

ADD
src/Chapter20/Listing20.15.SynchronousHighLatencyInvocationInWPFUsingAwait.cs
+namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_15
+{
+ public class Program
+ {
+ async private void PingButton_Click(
+ object sender, RoutedEventArgs e)
+ {
+ StatusLabel.Content = "Pinging...";
+ UpdateLayout();
+ Ping ping = new Ping();
+ PingReply pingReply =
+ await ping.SendPingAsync("www.IntelliTect.com");
+ StatusLabel.Text = pingReply.Status.ToString();
+ }
+
+ }
+}
+
+
+
+
+

Resequenced to Ch 20 to match manuscript