using System;
public enum LegalDoorStates
{
DoorStateOpen,
DoorStateClosed
}
class DoorController
{
private LegalDoorStates CurrentState;
public LegalDoorStates State
{
get
{
return CurrentState;
}
set
{
CurrentState = value;
}
}
}
class MainClass
{
public static void Main()
{
DoorController Door;
string EnumName;
Door = new DoorController();
Door.State = LegalDoorStates.DoorStateOpen;
EnumName = LegalDoorStates.GetName(typeof(LegalDoorStates), Door.State);
Console.WriteLine(EnumName);
}
}
|