If I have the following scenario
public interface IFace
{
int NoseSize {get; set;}
}
public class Face: IFace
{
private int NoseSize;
public int IFace.NoseSize
{
get { return ClassLevel.NoseSize}
set { ClassLevel.NoseSize = value}
}
}
How do I really indicate “ClassLevel”?
Simply refer to it as
NoseSizeorthis.NoseSizeif you like.By the way, you are not correctly implementing the interface. If you want to use explicit interface implementation, you cannot specify an access modifier.
If you want to implement the interface implicitly, you should omit the interface name and simply have a public member that matches the interface member name and signature. Of course, if you do that, you can’t have an identically named field in the same class.