Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# accept any enum

public static void MyFunction<T>(T en) where T: IComparable, IFormattable, IConvertible
{
    if (!typeof(T).IsEnum)
        throw new ArgumentException("en must be enum type");
    // implementation
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #accept #enum
ADD COMMENT
Topic
Name
4+1 =