Robert Jordan wrote:
> You call methods of generic classes like every other method.
> The "trick" is to get the method from the "inflated" class,
> which you can obtain from mono_object_get_class ().
> 
> MonoClass *clazz = mono_object_get_class (obj);
> 
> /*
>   * untested. If there are more Add methods declared, you
>   * may use mono_method_desc_search_in_class (clazz, ":Add(T)")

Substitute the correct type for "T", i.e. for IList<int>
the desc will be ":Add(int)".

>   */
> MonoMethod *method = mono_class_get_method_from_name (clazz, "Add", 1);
> 
> mono_runtime_invoke (method, obj, args, &exception);

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to