home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Using reflection for GUIControlFactory
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Anonymous" data-source="post: 683"><p>I've been going over the source, trying to see where I can contribute and came across GUIControlFactory.cs. </p><p></p><p>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. </p><p></p><p>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. </p><p></p><p>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.</p><p></p><p>Any comments?</p><p></p><p>-Suicidal</p></blockquote><p></p>
[QUOTE="Anonymous, post: 683"] 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 [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Using reflection for GUIControlFactory
Contact us
RSS
Top
Bottom