I understand that the ClientBase<T>
class explicitly implements the IDisposable
interface, however I don't understand why it was done explicitly.
ClientBase doesn't implement IDisposable member
If MyClient
derives from ClientBase<T>
I cannot explicitly Dispose
of the object this way:
MyClient client = new MyClient();
client.Dispose();
Unless I cast to the underlying interface or implement the object lifetime with the using
statement design pattern:
((IDisposable)client).Dispose();
What is the benefit of Microsoft hiding the Dispose
method on this class through explicit interface implementation when they could have made it public and allowed the developer to explicitly call it?
Its not as if the class ClientBase<T>
is implementing two different interfaces with conflicting method declarations, therefore I see explicit interface implementation unnecessary in this circumstance unless there is something I've missed..........