public static void Main()
Type diagramtype = typeof(DiagramType);
var myDiagramType = (DiagramType) 0;
var myDiagramType2 = new DiagramType();
var myDiagramColor = DiagramColor.Green;
Console.WriteLine("Diagram Types:");
foreach ( string s in Enum.GetNames(diagramtype) )
Console.WriteLine( "{0,-11}= {1}", s, Enum.Format( diagramtype, Enum.Parse(diagramtype, s), "d"));
DiagramColor myColors = DiagramColor.Red | DiagramColor.Blue | DiagramColor.Yellow;
Console.WriteLine("My COLORS: {0}", myColors);
Console.WriteLine(myDiagramType);
Console.WriteLine(myDiagramType2.ToString());
Console.WriteLine(myDiagramColor);
string[] formats= { "G", "F", "D", "X"};
foreach (var fmt in formats)
Console.WriteLine(myDiagramColor.ToString(fmt));
bool checkParse = Enum.TryParse( test, out getParse);
Console.WriteLine(getParse);
enum DiagramType {Class, Object, Process }
enum DiagramColor {Red=1, Green=2, Yellow=4, Blue=8}
enum DiagramSize {Small = 100, Medium = 200, Large = 400}
enum DiagramForm {Square = 1, Round =2, RoundedSquare = 3}