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.
            Asked
            
        
        
            Active
            
        
            Viewed 1,238 times
        
    0
            
            
         
    
    
        disasterkid
        
- 6,948
- 25
- 94
- 179
- 
                    A collection is always ordered (apart from those which implement `ISet`, `IDictionary`). – Tim Schmelter Oct 07 '14 at 07:17
1 Answers
2
            
            
        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!
 
    
    
        Patrick Hofman
        
- 153,850
- 22
- 249
- 325