You have to look for a FieldDefinition named "value__" in the
TypeDefinition corresponding to your enumeration and than check its
FieldType.

On 9 août, 16:50, Timwi <[email protected]> wrote:
> Hi
>
> Suppose I have a TypeDefinition that refers to an enum type, e.g.
>
>     enum MyEnum { One, Two, Three }
>
> How do I determine that this enum is of size Int32? Similarly, if I
> have it declared like this:
>
>     enum MyEnum : long { One, Two, Three }
>
> I need to know that it is Int64.
>
> I looked at the properties of TypeDefinition, and the only ones that
> sound vaguely relevant are "ClassSize" and "PackingSize", but both are
> -1. The "BaseType" property is, of course, set to System.Enum.
>
> Thanks for any help!
> Timwi

-- 
--
mono-cecil

Reply via email to