Warnings through Chapter 19
MODIFY
src/Chapter19/Listing19.07.RegisteringForUnhandledExceptions.cs
src/Chapter19/Listing19.07.RegisteringForUnhandledExceptions.cs
{
try
{
- ManualResetEventSlim resetEvent = new ManualResetEventSlim();
_Clock.Start();
// Register a callback to receive notifications
// of any unhandled exception
static void Message(string text)
{
- Console.WriteLine("{0}:{1:0000}:{2}",Thread.CurrentThread.ManagedThreadId,_Clock.ElapsedMilliseconds, text);
+ Console.WriteLine("{0}:{1:0000}:{2}",
+ Thread.CurrentThread.ManagedThreadId,
+ _Clock.ElapsedMilliseconds, text);
}
}
}

MODIFY
src/Chapter19/Listing19.09.UsingTaskRun.cs
src/Chapter19/Listing19.09.UsingTaskRun.cs
public class Program
{
- public Task<string> CalculatePiAsync(int digits)
+ public static Task<string> CalculatePiAsync(int digits)
{
return Task.Factory.StartNew<string>(
- () => CalculatePi(digits));
+ () => Program.CalculatePi(digits));
}
- private string CalculatePi(int digits)
+ private static string CalculatePi(int digits)
{
// ...

Warnings through Chapter 19