Search code examples
visual-studiocollectionsapplication-settings

User Settings: What are my choices?


I'm trying to find out what my choices are when I'm going to use user (persistent) settings.

In vs Studio this is possible in the properties of your project but I'm getting to know the limits there:

  • Only values are allowed that can be converted to string.

  • Collections (e.g items in a Listbox, with a name and value) cannot be saved.

What I would like to know, how do you implement user settings with collections, and how do you make user settings?

Emerion


Solution

  • If I understand correctly I think you're probably looking for serialization, and since you mention values that can't be converted to string I assume that you'd probably want binary serialization.

    The System.Runtime.Serialization namespace contains classes to help you with this and here's an article that might be useful: Serialization in the .NET Framework