-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter10 process exit #148
Conversation
… correct SUT listings.
@@ -22,13 +23,22 @@ public TemporaryFileStream() | |||
Close(); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match v8.0 print:
catch(Exception exception)
{
//Write event to logs or UI
//...
}
after this from the book
|
||
#region IDisposable Members | ||
public void Dispose() | ||
{ | ||
Dispose(true); | ||
|
||
// Turn off calling the finalizer | ||
System.GC.SuppressFinalize(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match v8.0 print:
// Unregister from the finalization queue
System.GC.SuppressFinalize(this);
@@ -67,8 +58,20 @@ public void Dispose(bool disposing) | |||
if (disposing) | |||
{ | |||
Stream?.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match v8.0 print:
if(disposing)
{
Stream?.Close();
}
public static void Main(string[] args) | ||
{ | ||
WriteLine("Starting..."); | ||
DoStuff(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match v8.0 print:
line 14.5,
if (args.Any(arg => arg.ToLower() == "-gc"))
{
GC.Collect();
GC.WaitForPendingFinalizers();
}
WriteLine("Exiting...");
{ | ||
WriteLine("Starting..."); | ||
SampleUnmanagedResource sampleUnmanagedResource = | ||
new SampleUnmanagedResource(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match v8.0 print:
REMOVE
new SampleUnmanagedResource();
// ... | ||
WriteLine("Exiting..."); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match v8.0 print:
Replace lines 25-36 with
try
{
sampleUnmanagedResource =
new SampleUnmanagedResource();
// Use unmanaged resource.
// ...
}
finally
{
if (Environment.GetCommandLineArgs().Any(
arg => arg.ToLower() == "-dispose"))
{
sampleUnmanagedResource?.Dispose();
}
}
WriteLine("Exiting...");
// ...
}
}
} | ||
} | ||
|
||
public static class ConsoleLogger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match v8.0 print:
Lines 107 to eof do not exist in print
@@ -7,7 +7,7 @@ | |||
using System.Threading; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This File is very different than v8.0 printing
@@ -1,5 +1,5 @@ | |||
|
|||
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very Different from v8.0 print
@@ -4,7 +4,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_11 | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
|
|||
class Program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont do this change, doesn't match v8.0 printing
Implemented in PR #151 instead to only take some of the changes |
Implementation of Chapter10 process exit PR #148
No description provided.