i am embedding Mono to use it for scripting in my application. I would like to access properties. To make sure the type my application expects is equivalent to the type of some property i need to check the property’s type.
My problem is, that i have not found a way to access the property’s type.
For fields there is a single function namely mono_field_get_type. I know how to get the signature of a the property’s getter-/setter-method, but i could not find any function to access for example the return type of the getter-method.
Can you tell me how to retrieve the type of a property?
For those who like to see some code:
MonoType* MonoScriptPropertyVariableSource::getType(MonoObject* instance, MonoProperty* prop)
{
// MonoMethod* method = mono_property_get_get_method(prop);
// MonoMethodSignature* sig = mono_method_get_signature(method, 0, 0);
// and now? ...
return ...
}
return mono_signature_get_return_type (sig);
Other accessors for MonoSignature are in metadata.h.