[Mono-dev] Embedding Scenario with MonoReflectionType

Laurent Etiemble laurent.etiemble at gmail.com
Mon Mar 22 06:06:54 EDT 2010


Hello,

Thanks, this is all I need.

Regards, Laurent Etiemble.

2010/3/22 Robert Jordan <robertj at gmx.net>

> On 22.03.2010 09:38, Laurent Etiemble wrote:
> > 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:
> >
>
> There is no way to the a MonoType* from a MonoReflectionType*
> than getting it from Type.TypeHandle.Value.
>
> Here is a solution for your problem:
>
>
> [MethodImplAttribute(MethodImplOptions.InternalCall)]
> public static extern String GetName(IntPtr typeHandle);
>
> public static String GetName(Type type)
> {
>     return GetName (type.TypeHandle.Value);
> }
>
> >
> > Then, the implementation should look like:
> >
> > MonoString *ves_icall_XXX_ GetName(MonoReflectionType *type) {
>
>
> MonoString *ves_icall_XXX_ GetName(MonoType *type)
> {
> ...
> }
>
>
> Robert
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100322/39ef9730/attachment.html 


More information about the Mono-devel-list mailing list