public interface IParent
public interface IOne : IParent
public interface ITwo : IParent
public class SomeClass : IOne, ITwo
Attempting to declare ParentMethod explicitly as a member of IOne fails to compile as not a member of IOne, e.g.
"void IOne.ParentMethod()" within SomeClass will not compile whereas void IOne.OneMethod is fine.
This behaves as expected when instantiating a SomeClass object and using it via the interfaces
SomeClass oSomeClass = new SomeClass();
IOne iOne = (IOne) oSomeClass;
ITwo iTwo = (ITwo) oSomeClass;
IParent iParent = (IParent) oSomeClass;
FootNote 1: I did subsequently find some related information in the C# language specification
my favorite section to date in 13.1.2: "The base interfaces of an interface are the explicit base interfaces and
their base interfaces. In other words, the set of base interfaces is the complete transitive closure of the
explicit base interfaces, their explicit base interfaces, and so on." Hmmm, is my case a complete or a partial
transitive closure? Being more of a practitioner and less of an academecian these days, I read on... Section 13.2.5 is more germaine, dealing with more complex cases than what I had. It implicitly clarified my argualbly more common case. Isn't dot Net fun?