I would like to know if 'theObject' is an enum (of any enum type)
foreach (var item in Enum.GetValues(theObject.GetType())) {
//do something
}
I would like to know if 'theObject' is an enum (of any enum type)
foreach (var item in Enum.GetValues(theObject.GetType())) {
//do something
}
Use the Type.IsEnum
property, e.g.:
bool isEnum = theObject.GetType().IsEnum;