Dispose pattern: How do I know what's managed and what's unmanaged?

dispose, unmanaged

Solution

The short version is: anything that also implements `IDisposable` needs to be called in your `Dispose` method. FxCop will also tell you if you're missing something (or not using `IDisposable` at all when you should be).

Problem

Reading about the Dispose pattern, I see the documentation repeatedly refer to "cleaning up managed and unmanaged code". And in the canonical implementation of the `Dispose` method, I see specific flows (depending on whether `disposing` is true or false) dedicated to the cleanup of managed objects versus unmanaged objects. But am I, the lowly newbie, to know which types are managed and which are unmanaged?

Original source