Create Enum and Create Struct

195 views
Skip to first unread message

BlackSky Blacksky

unread,
Nov 13, 2014, 10:26:33 AM11/13/14
to mono-...@googlegroups.com
Hello,

I already did some research but wasn't able to find questions similar to mine.
So, I like to know how I can create an Enumeration with Cecil and also how I can Create a Struct, and how I can define their Datatypes and the Constants/Variables they hold.
There didn't find something like an EnumerationDefinition or StructDefinition in the Cecil lib, so I decided to ask you guys here :)
Anyone? :P


Andriy Tylychko

unread,
Nov 14, 2014, 7:26:39 AM11/14/14
to mono-...@googlegroups.com
If you check assembly IL by any disasm (MS ildasm.exe or ILSpy) you can see that enums and structs are classes with specific flags. Enum elements are just static fields of a class. My suggestion is before of generating anything by Cecil implement it in C# or any other language that produce IL and check generated byte code.

Jb Evain

unread,
Nov 14, 2014, 7:46:50 AM11/14/14
to mono-...@googlegroups.com
That's the best way to do it!
> --
> --
> --
> mono-cecil
> ---
> You received this message because you are subscribed to the Google Groups
> "mono-cecil" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mono-cecil+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages