I have the following code in C# (.Net)
public class A
{
protected internal enum Color {WHITE, BLACK};
}
public class B
{
protected internal int methodOne(A.Color color)
{
if (color == A.Color.WHITE)
return 1;
return 2;
}
}
But I'm getting the following error: error CS0051: Inconsistent accessibility: parameter type 'A.Color' is less accessible than method 'B.methodOne(A.Color)'
Why does it say the parameter is "less accessible" when both the parameter type and the method have the same access modifier (protected internal)?
Update #1: this is what I really want to achieve:
public class A
{
internal enum Color {WHITE, BLACK};
}
public class B
{
protected int methodOne(A.Color color)
{
if (color == A.Color.WHITE)
return 1;
return 2;
}
}
public class C : B
{
int methodTwo()
{
return methodOne(A.Color.WHITE);
}
}
I want to keep enum Color as internal, and I want methodOne to be accessible only by derived classes. Is this possible?