Test if an object is an Enum
If you have a Type
, use the Type.IsEnum
property, e.g.:
bool isEnum = theObject.GetType().IsEnum;
The question is the answer. :)
bool isEnum = theObject is Enum;
If you have a Type
, use the Type.IsEnum
property, e.g.:
bool isEnum = theObject.GetType().IsEnum;
The question is the answer. :)
bool isEnum = theObject is Enum;