Is there a best practices for storing UI settings in a file?

c#, configuration-files, settings, user-interface

Solution

You can also define a custom configuration section and then put the settings in a separate config file if you didn't want to clutter up your app.config. A custom configuration module allows you to define a structure for your own complex settings and store them in a standard config file. If you have used Entity Framework, Enterprise Library or the like, then you have probably seen them defined at the top of the file. A quick search on Google turned up another StackOverflow post on the subject.

How to create custom config section in app.config

Problem

I have not seeing an satisfactory answer for this yet, so thought I'd ask. Are there any best practices for storing UI settings in a file? The scenario is that we have an in house C# app that I want to store an array of file/folders in along with other random things (flags to use when executing an external command, optional arguments to pass to selectable compare algorithms, etc). Because of the nature of these values, using the built in app.config methods isn't going to work. So is there any best practices when storing semi-complex settings to an setting file? Currently the most complex I'm storing will be a list with a single entry needing to store a file name, compare algorithm, and argument text. So it's not all simple key/value data. I'm looking for thoughts on: - layout (ex. if XML, values should be in the attributes vs node.value) - format (XML, YAML, etc) - frameworks This won't be storing sensitive data, so security isn't a concern. I'm currently looking to just use XmlDocument and separate classes for each different collection. But I feel like there should be some existing framework for this already. Thank you!

Original source

Related problems