Say I have an interface like this:
public interface MyInterface { int Property1 { get; } void Method1(); void Method2(); }
Is there a way to get an interface developer to implement it explicitly? Sort of:
public interface MyInterface { int Property1 { get; } explicit void Method1(); explicit void Method2(); }
Edit: As for why I care about whether the interface is implemented explicitly or not; this is not so important as the functionality goes, but it may be useful to hide some unnecessary data from people using the code.
I am trying to simulate multiple inheritance on my system using this pattern:
public interface IMovable { MovableComponent MovableComponent { get; } } public struct MovableComponent { private Vector2 position; private Vector2 velocity; private Vector2 acceleration; public int Method1() {
If the MovableComponent property was implemented explicitly, in most cases it would be hidden from the person who used this class. I hope this explanation was not too terrible.
source share