Mega Code Archive

 
Categories / C# Tutorial / Data Type
 

Using the LegalDoorStates Enumeration

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;             Door = new DoorController();             Door.State = LegalDoorStates.DoorStateOpen;     } }