using app config to create a dynamic menu [Archive] - C Board

PDA

View Full Version : using app config to create a dynamic menu


dana_cc1
03-31-2008, 08:45 AM
Hi,

I'm trying to create a menu that shows the user a list of options. The options can be added to via the app config file.

right now I am using an enum to print the menu but I want to know if I can read the app config file to create it, in case the list has been added to.

that way I know the menu is allways updated.

mike_g
04-01-2008, 06:28 PM
Short answer is yes. I'm sorry I cant help you much more. Closest I know to C# is java, check out how to parse text from files and load the content to your 'menu item' objects. C# probably supports loading object data from XML files, which is quite an easy way to go around things if you are loading multiple varibles for each object (although XML bloats the files quite alot).

TheRaven
04-29-2008, 11:29 PM
Your best bet is to learn how to add and reference resource files in VS Express or what ever license version you have, if any.

What you want to do could be achieved using an XML resource file that could be considered to be very much like an .ini/initialization file.

MSDN online/Express Ed. will certainly have some info. regarding this topic. You may also want to visit "The Code Project" online and access their C# oriented resources. There are plenty of resources and examples out there regarding the topic ranging from ini. system startup, to internationalization using XML resource files to streamline the process.