On 23.03.2015 15:13, LinWuxiang wrote:
Hello everybody.

How can I instantiate a generic type, like List<String> from mscorlib?

I thought I should use “mono_class_from_generic_parameter”, but not sure
how to use this function.

There used to be no embedding APIs for this in the past, and it
doesn't look that this was changed.

You can achieve this by mono_runtime_invoke()-ing
System.Type.MakeGenericType (see MSDN).

Note that System.Type is represented by MonoReflectionType*
in the embedding world. You can get the MonoReflectionType*
of a MonoType* with mono_type_get_object().

You can get back the MonoType* of a MonoReflectionType* with
mono_reflection_type_get_type().

Robert


_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to