Beispiel #1
0
            public static void MainMethod()
            {
                // instantiate type
                Enumtricks enumtricks = new Enumtricks();

                // demonstrates explicit cast
                // of int to Volume
                enumtricks.GetEnumFromUser();

                // iterate through Volume enum by name
                enumtricks.ListEnumMembersByName();

                // iterate through Volume enum by value
                enumtricks.ListEnumMembersByValue();
            }
    static void Main(string[] args)
    {
        // instantiate type
        Enumtricks enumtricks = new Enumtricks();

        // demonstrates explicit cast
        // of int to Volume
        enumtricks.GetEnumFromUser();

        // iterate through Volume enum by name
        enumtricks.ListEnumMembersByName();

        // iterate through Volume enum by value
        enumtricks.ListEnumMembersByValue();

        Console.ReadLine();
    }