Question

I use the built-in Settings file to store the state of controls on form.

I use System.collections.Specialized.StringCollection and would like to use a list of int values.

Is there a way to do so?

Was it helpful?

Solution

There is no List<T> in the settings, so you have to convert it yourself:

var strings = Properties.Settings.Default.Strings; // your StringCollection 
List<int> ints = strings.Cast<string>().Select(str => int.Parse(str)).ToList();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top