[Mono-dev] Extract MonoField

Zoltan Varga vargaz at gmail.com
Wed Jun 10 19:37:18 EDT 2009


Hi,

  Use mono_class_from_mono_type () instead of mono_type_get_class (), no
idea what
the latter does.

                  Zoltan

On Thu, Jun 11, 2009 at 1:24 AM, Joachim Ante <joe at unity3d.com> wrote:

> Hi,
>
> I have this class on the C# side.
> class Test
> {
>    List<int> myValue;
> }
>
>  From the embedding API I iterate through the list using
> mono_class_get_fields.
>
> When iterating through the Test class I need to call mono_object_new
> or something similar, so that the it creates the equivalent of:
> new List<int> ();
>
>
> How do i do that? With non-generic classes I would just call
> klass = mono_type_get_class(mono_field_get_type(field));
> To extract the class and then pass it into mono_object_new. How do i
> do that with generics. Doing the same as with non-generics seems to
> just crash mono, so i presume there are some extra steps i have to do.
>
> Joachim Ante
> _______________________________________________
> 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/20090611/704b8efe/attachment.html 


More information about the Mono-devel-list mailing list