@TheCPUWizard said:
@Sutherlands said:
Quoting fail. I'm not sure what you're saying, exactly, but you make me look at it and say "this isn't even a valid scenario, since it will dispose of the object and you won't be able to use it."Disposing can object is nothing more than calling a method on that object. There is nothing inherent in this that means " you won't be able to use it", unless the developer of the class in question has explicitly coded in functionallity to detect the call to Dispose and do something special.
...which is the exact semantics that IDisposable demands. If you call Dispose() on, say, a Stream, then calling any of its instance methods will cause an ObjectDisposedException to be thrown. If an object doesn't have any special dispose logic, then it shouldn't even have a Dispose() method.
To paraphase Blakeyrat, this shit isn't hard people.