[Mono-dev] Embedding Scenario with MonoReflectionType

Laurent Etiemble laurent.etiemble at gmail.com
Mon Mar 22 04:38:50 EDT 2010


Hello,

I am working on embedding Mono and I am stuck with the following issue: I
would like to get a MonoClass or a MonoType instance from
a MonoReflectionType instance.

So, imagine I have an internal call with the following signature:

[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern String GetName(Type type);

Then, the implementation should look like:

MonoString *ves_icall_XXX_ GetName(MonoReflectionType *type) {
    MonoType *theType = mono_XXX(type); // <-- Don't seem to exist in the
embedding API
    // xor
    MonoClass *theClass = mono_YYY(type); // <-- Don't seem to exist in the
embedding API

    const char *name = mono_type_get_name(theType);
    // xor
    const char *name = mono_class_get_name(theClass);

    return mono_string_new(mono_domain_get(), name);
}

I have taken a look to the Marshal internal calls, but they access directly
the MonoReflectionType structure.

Is there any public API to get a MonoClass or a MonoType instance from
a MonoReflectionType instance ?

Regards, Laurent Etiemble.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100322/3abf4212/attachment.html 


More information about the Mono-devel-list mailing list