0
votes

I have a string array of information that I need to pass from one user control to the other. The application settings contains a System.Collection.Specialized.StringCollection datatype for such cases. But since I need to use my array in a specific order, does a string collection help? Apart from that is it even a good idea to save such parameters in the application settings or is there a better way of passing these arguments around the program? I have used EventListeners in the program as well but passing arguments from one user control to the other seems less convenient with them.

1
A collection is always ordered (apart from those which implement ISet<T>, IDictionary). - Tim Schmelter

1 Answers

2
votes

StringCollection is ordered in the way you inserted, so that would be sufficient for you.

As a tip: you can edit the Settings.settings file to change the data type of any field:

<Setting Name="Setting" Type="System.String[]" Scope="User">
  <Value Profile="(Default)"></Value>
</Setting>

Be advised that the type you define must the XML serializable!