示例#1
0
        static void Main(string[] args)
        {
            Coolness coolType1 = Coolness.Cool;
            Coolness coolType2 = Coolness.NotSoCool;

            Console.WriteLine(GetDescription(coolType1));
            Console.WriteLine(GetDescription(coolType2));
        }
    public static string ToString(this Coolness coolness)
    {
        switch (coolness)
        {
        case Coolness.NotSoCool:
            return("Not so cool");

        case Coolness.Cool:
            return("Cool");

        case Coolness.VeryCool:
            return("Very cool");

        case Coolness.SuperCool:
            return(Properties.Settings.Default["SuperCoolDescription"].ToString());

        default:
            throw new ArgumentException("Unknown amount of coolness", nameof(coolness));
        }
    }
 public void MethodEnum3(Season season, Coolness coolness, int age, EnumEnum enumEnum)
 {
     Log($"MethodEnum3: {season}, {coolness}, {enumEnum}.");
 }
 public void MethodEnum(Coolness coolness)
 {
     Log($"MethodEnum: {coolness}.");
 }