[Mono-list] late linking & dynamic invocation ...

Gonzalo Paniagua Javier gonzalo@gnome-db.org
Wed, 26 Jun 2002 23:03:30 +0200


* [ Michael Meeks <michael@ximian.com>
* Wed, 26 Jun 2002 18:10:25 +0200 ]
> 	a) A way to specify that a certain object is extremely late 
> 	   linked, such that I can invoke arbitrary methods on it, and
> 	   the compiler will do ~no checking eg.
> 
> 	LateLinkType t = (LateLinkType) myObject;
> 
> 	t.unknownMethod ("astring");
> 

Not sure about this, but you can use TypeBuilder to hold your stub,
complete it as you know how it should be (adding methods), then use
MethodBuilder to add some code to the methods, then you can create an
instance of the type using:

Activator.CreateInstance (typeBuilder.CreateType (), null);

I repeat, not sure about this.

-- 
Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
http://www.gnome-db.org/~gonzalo/