A
Anonymous
Guest
I've been going over the source, trying to see where I can contribute and came across GUIControlFactory.cs.
Is there any reason that reflection isn't used to set the properties on the controls? This would make maintenance of this class trivial since a piece of generic code could be written (using reflection) that would set the properties on the controls as xml nodes are encountered. This adds some restrictions on the xml format (the node names must match the property names) but this would make adding properties and new controls relatively trivial rather than special casing the code for each control.
To do this will require a slight change to the control objects as they'll all need empty constructors and an init function to take the place of the code that was in the current constructors.
Doing this will also enable the ability to log nodes in the xml that don't actually pertain to a property on the control, eventually a DTD could be created based off of the object definitions themselves.
Any comments?
-Suicidal
Is there any reason that reflection isn't used to set the properties on the controls? This would make maintenance of this class trivial since a piece of generic code could be written (using reflection) that would set the properties on the controls as xml nodes are encountered. This adds some restrictions on the xml format (the node names must match the property names) but this would make adding properties and new controls relatively trivial rather than special casing the code for each control.
To do this will require a slight change to the control objects as they'll all need empty constructors and an init function to take the place of the code that was in the current constructors.
Doing this will also enable the ability to log nodes in the xml that don't actually pertain to a property on the control, eventually a DTD could be created based off of the object definitions themselves.
Any comments?
-Suicidal