I have an interface
Interface:
interface IThing
{
Enum MyEnum {get;set;}
string DoAction(MyEnum enumOptionChosen, string valueToPassIn);
}
Concrete implementation:
public class Thing : IThing
{
public enum MyEnum
{
FirstOption,
SecondOption,
ThirdOption
}
string doAction(MyEnum enumOptionChosen, string valueToPassIn)
{
switch(enumOptionChosen)
{
case MyEnum.FirstOption:
x();
break;
case MyEnum.SecondOption:
y();
break;
case MyEnum.ThirdOption:
z();
break;
}
}
}
When I try compiling this I get 'IThing.MyEnum' is a 'property' but is used like a 'type.' I'm missing something about being able to require use of the Enum in the DoAction() signature.
Thanks for any help.