How does one tell if an IDisposable object reference is disposed?

Neil C. Obremski picture Neil C. Obremski · Oct 10, 2008 · Viewed 44.4k times · Source

Is there a method, or some other light-weight way, to check if a reference is to a disposed object?

P.S. - This is just a curiousity (sleep well, not in production code). Yes, I know I can catch the ObjectDisposedException upon trying to access a member of the object.

Answer

Dandikas picture Dandikas · Oct 10, 2008

No - default implementation of IDisposable pattern does not support it