Here’s a neat little thing about Visual Studio 2005 IDE for Visual
Basic.Net. When you implement the IDisposable interface, the
following code is automatically created for you. This is
different from other interfaces in that only the code stubs/shell (empty methods)
are produced for other interfaces. The auto-cdoe for IDisposable
actually produces the code needed for the entire implementation except
for the actual cleaning up of resources. The private fields,
Public Dispose Sub and Finalize come complete with no needed
modifications so that nothing gets left out. However, if you
forget to clean up a managed or unmanaged resource in the Private
Dispose(bool) method, that's your own fault :). Update: As Blair mentioned in the comments, for C# IDE you can right click on the IDisposable term and pick if you want to explicitly
or implictly fill in the stubs for the interface.
Posted
05-11-2005 8:17 AM
by
Raymond Lewallen