Test if an object is an Enum

Posted by Aran Mulholland on Stack Overflow See other posts from Stack Overflow or by Aran Mulholland
Published on 2010-05-27T06:00:01Z Indexed on 2010/05/27 6:41 UTC
Read the original article Hit count: 146

Filed under:
|
|

I would like to know if 'theObject' is an enum (of any enum type)

 foreach (var item in Enum.GetValues(theObject.GetType())) {

     //do something
 }

© Stack Overflow or respective owner

Related posts about c#

Related posts about enums