Visual Studio code generated when choosing to explicitly implement interface

Posted by fearofawhackplanet on Stack Overflow See other posts from Stack Overflow or by fearofawhackplanet
Published on 2010-06-03T09:22:07Z Indexed on 2010/06/03 9:24 UTC
Read the original article Hit count: 145

Sorry for the vague title, but I'm not sure what this is called.

Say I add IDisposable to my class, Visual Studio can create the method stub for me. But it creates the stub like:

void IDisposable.Dispose()

I don't follow what this syntax is doing. Why do it like this instead of public void Dispose()?

And with the first syntax, I couldn't work out how to call Dispose() from within my class (in my destructor).

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about code-generation