[Mono-dev] Extract MonoField

Joachim Ante joe at unity3d.com
Wed Jun 10 19:24:28 EDT 2009


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


More information about the Mono-devel-list mailing list