Hi,

On 07.12.2012 07:49, Bartosz Przygoda wrote:
Hi,

Currently I am obtaining the MonoClass* objects via mono_class_from_name
which acts upon the MonoImage of provided assembly.

However, I am planning my project to span throughout few assemblies and I
still want the native host to be able to load classes by name. Do I have to
track the loaded assemblies, and when class is requested, iterate over all
of them and look for it in each one?

Yes, you have to, but you could reuse BCL's Type.GetType
by implementing the following code in a helper assembly
and mono_runtime_invoke it:

// returns the MonoType* of the specified type name
public static IntPtr GetType (string typeName)
{
    return Type.GetType (typeName, true).TypeHandle.Value;
}

Then use assembly qualified type names as "typeName", e.g.

"Namespace.Class, SomeAssemblyNameWithoutDllExtension"

Robert


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

Reply via email to