Appendix B - WDABase class
On page 645, when I add the line:
Implements IDisposable
my code that is automatically populated does not match what is listed (not highlighted) in number 7. Rather than:
Private Overloads Sub Dispose(ByVal disposing As Boolean)
If Not Me.disposed Then
If disposing Then
'TODO: put code to disposed managed resources
I get:
#Region " IDisposable Support "
' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(ByVal disposing _
' As Boolean) above.
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
which seems to refer above to this:
Private disposedValue As Boolean = False ' To detect redundant calls
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: free unmanaged resources when explicitly called
End If
' TODO: free shared unmanaged resources
End If
Me.disposedValue = True
End Sub
I think this is where I am supposed to enter the code in number 7, but it seems to me (though I will admit I am a wet-behind-the-ears newbie) that a "Protected Overridable Sub" is not the same thing as a "Private Overloads Sub".
Anybody know what is going on? Where is my error?
|