The syntax you want is:
enum foo { one, two } interface Ibar { foo foo { get; } } class bar : Ibar { foo foo { get { return foo.one; } } }
You use only enum to define a new enumeration; when creating a member variable, you use the name of the enum you created.
However, you would be much better off not calling the member variable the same as the enum type:
enum FooEnum { One, Two } interface IBar { FooEnum FooValue { get; } } class Bar : IBar { FooEnum FooValue { get { return FooEnum.one; } } }
(Note. I used only enum and Value to figure out what type of enum and which is the value, do not do this.)
(Also, I think this is more like regular C # usage conventions.)
source share