2010-10-18, 12:29 PM
XML. I hate it. At the best of times
Anyway, ranting aside, what's the best way to store and retrieve settings (in config.xml) that would be stored in the same format as the main menu buttons, ie:
If have existing code from the System plugin (see attached) that can deal with basic string and primitive values, but I'm not sure how to go about handling anything more complicated. I really want to take my existing "Drives" and "Buttons" strings, and turn them into proper elements like the above. In fact, the "Buttons" could be identical to sub's settings, whereas the "Drives" would eventually need a few more attributes added too; something like:
(You can ignore the last two methods in my class)
Iain
Anyway, ranting aside, what's the best way to store and retrieve settings (in config.xml) that would be stored in the same format as the main menu buttons, ie:
Code:
<MenuItem enabled="true">System</MenuItem>
<MenuItem enabled="true">TV Guide</MenuItem>
<MenuItem enabled="true">Recordings</MenuItem>
If have existing code from the System plugin (see attached) that can deal with basic string and primitive values, but I'm not sure how to go about handling anything more complicated. I really want to take my existing "Drives" and "Buttons" strings, and turn them into proper elements like the above. In fact, the "Buttons" could be identical to sub's settings, whereas the "Drives" would eventually need a few more attributes added too; something like:
Code:
<Drive letter="c" icon="1" text="Windows">
<Drive letter="d" icon="2" text="Documents">
(You can ignore the last two methods in my class)
Iain