The difference is in supporting a situation where an interface method collides with another method. The idea of "Explicit interface implementations" is proposed.
Your first attempt is an explicit implementation that requires direct work with a link to the interface (and not a link to what the interface implements).
The second attempt is an implicit implementation, which also allows you to work with the type of implementation.
To see explicit interface methods, follow these steps:
MyType t = new MyType(); IMyInterface i = (IMyInterface)tiCallExplicitMethod();
If you have the following:
IMyOtherInterface oi = (MyOtherInterface)t; oi.CallExplicitMethod();
The type system can find the appropriate methods for the correct type without collision.
Adam houldsworth
source share