[Mono-list] PropertyInfo bug?

Kris Luyten kris.luyten@luc.ac.be
Wed, 17 Mar 2004 23:43:22 +0100


Hi,

I am implementing a library that relies heavily on reflection (a User
Interface Markup Language renderer). It dynamically sets properties of
widgets. Since the library does not know whether it is dealing with a
method or a property it tries to load the specified string (e.g.
"ModifyBg") as a property first, and when this fails it tries to load it
as a method.

Since a couple of weeks, the following code hangs, instead of throwing
an exception or just failing:

	Button b = new Button ("I am a button");
	PropertyInfo pInfo = b.GetType().GetProperty("ModifyBg");
	System.Object[] args= new System.Object[2];
	args[0] = StateType.Normal;
	args[1] = new Gdk.Color(255,0,0);
	pInfo.SetValue(b, args, null);

The second line of the code succeeds, although ModifyBg is a method
afaik. Still, the program hangs on the last line. If someone wants to
test the full example, it is available here:
http://research.edm.luc.ac.be/~kris/projects/uiml.net/examples/test16.cs

I am not sure whether this behavior is caused by a bug in mono or gtk#,
or a mistake I made.

my specs:
Debian Sid
Mono JIT compiler version 0.30.99.20040307
Mono C# compiler version 0.30.99.51827
Gtk# from CVS, two weeks old


Regards,
Kris
-- 
Kris Luyten
Expertisecentrum Digitale Media - Limburgs Universitair Centrum
Wetenschapspark 2
3590 Diepenbeek, Belgium
tel.: +32 (0)11 268411
email: kris.luyten@luc.ac.be
http://research.edm.luc.ac.be/kris