I was just doing some code analysis cleanup on some old code, and ran across
several classes that had the suggestion to implement IDisposable because
they created desposable resources internally.
After going through the exercise (I used ReSharper's Generate unimplemented
members), and realizing there was a definite pattern to the implementations,
I started to wonder if ReSharper couldn't just do most of the work in the
future? It should be easy to identify the members that are disposable, and
to implement the standard disposable pattern (as guided by the CodeAnalysis
messages).... Either mark the class as sealed and impiment Dispose, or
implement Dispose() as a call to Dispose(true) and then GC.SupressFinalize,
and implement Dispose(bool disposing) to dispose of all the disposable
types, and close any handles.
It might be a little "too narrow", but it sure would be helpful with
ensuring there aren't resource leaks, and in responding to Code Analysis