Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

enum in method as argument c#

public static void MyEnumMethod(Enum e)
    {
        var enumValues = Enum.GetValues(e.GetType());
        // you can iterate over enumValues with foreach
    }

MyEnumMethod(new MyEnum());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #enum #method #argument
ADD COMMENT
Topic
Name
4+2 =