using System;
public class Test
{
public enum DefaultColor
{
Red = 0,
Green = 1,
Blue = 2,
DarkBlue = 3
}
public enum MyColor
{
Red = 0,
Green = 1,
Blue = 2
}
public static void Main()
{
Console.WriteLine("Type casting int to mycolor :"+(MyColor)2);
Console.WriteLine("Type casting DefaultColor to mycolor :"+(MyColor)DefaultColor.Red);
Console.WriteLine("Type casting DefaultColor to mycolor :"+(MyColor)DefaultColor.DarkBlue);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIGVudW0gRGVmYXVsdENvbG9yCgl7CgkJUmVkID0gMCwKCQlHcmVlbiA9IDEsCgkJQmx1ZSA9IDIsCgkJRGFya0JsdWUgPSAzCgl9CglwdWJsaWMgZW51bSBNeUNvbG9yCgl7CgkJUmVkID0gMCwKCQlHcmVlbiA9IDEsCgkJQmx1ZSA9IDIKCX0KCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQlDb25zb2xlLldyaXRlTGluZSgiVHlwZSBjYXN0aW5nIGludCB0byBteWNvbG9yIDoiKyhNeUNvbG9yKTIpOwoJCUNvbnNvbGUuV3JpdGVMaW5lKCJUeXBlIGNhc3RpbmcgRGVmYXVsdENvbG9yIHRvIG15Y29sb3IgOiIrKE15Q29sb3IpRGVmYXVsdENvbG9yLlJlZCk7CgkJQ29uc29sZS5Xcml0ZUxpbmUoIlR5cGUgY2FzdGluZyBEZWZhdWx0Q29sb3IgdG8gbXljb2xvciA6IisoTXlDb2xvcilEZWZhdWx0Q29sb3IuRGFya0JsdWUpOwoJfQp9