Thursday, May 27, 2010

Enums in C#

correct usage:

class myClass
{
public enum myEnumType {Value1, Value2};
public myEnumType myEnumVariable;
}

class myOtherClass
{
public myFunction()
{
myClass foo = new myClass();
foo.myEnumVariable = myClass.myEnumType.Value1;
}
}

No comments: