|
IDisposable (C#, VB.NET)
|
Top |
Implements IDisposable pattern with the statements.
Features:
- Supports public, explicit, abstract, and extended implementations.
- Supports implementation kind change (refactor itself).
- Optionally you can select any field reference types that implemets IDisposable interface
to generate code for the call to their Dispose() methods.
- Can re-generate the statements of any methods that were left blank. This is a quick
way to synchronise the overloaded Dispose() method with the latest changes in your
type.
- Supports disposing elements of an extended generic collection type that the constructed
type has implemeted IDisposable interface. (C# only)
Notes:
Smart IDisposable command always casts the selected fields before
it calls the Dispose() method to ensure the right method is called. In C# you can
have a public Dispose() method that may or may not call the private implemented
IDisposable.Dispose() method. Also in VB.NET the extended member of an Interface
does not need to match the name of the interface member, unlike C#. To avoid these
issues it would be a safe bet to cast the fields to IDisposable before calling the
Dispose() method.
|