You can implement the interface explicitly and have the implementation hidden:
public class UrClass : ICollection
{
void ICollection.Clear() { ... }
}
The user can't call urClassInstance.Clear()
directly, but they can call ((ICollection)urClassInstance).Clear()
indirectly like this.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…