This is probably a stupid question, but I can\'t seem to do it. I want to set up some enums in one class like this:
public enum Direction { north, east, south,
Declare enum in the scope of a namespace like a class but not into a class:
namespace MyApplication
{
public enum Direction { north, east, south, west };
}
In case enum is declared in the scope of a class, you have make this class public too:
namespace MyApplication
{
public class MyClass
{
public enum Direction { north, east, south, west };
}
}
Usage:
MyClass.Direction dir = ...