DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Switch Case With Enum

03.26.2012
| 2364 views |
  • submit to reddit
        Switch case with Enum

enum Stages
{
	One,
	Two,
	Three
};

	Stages s = Stages.Three

	switch (s.Three)
	{
	    case Priority.One:
	    case Priority.Two:
 		Console.WriteLine("One or Two");
	    default:
 		Console.WriteLine("Three");
	}