Closed jhoek closed 9 years ago
System.Web.Util namespace in System.Web.Extensions.dll contains a generic OrderedDictionary. System.Runtime.Collections also contains an internal OrderedDictionary<TKey, TValue>.
Changed this for page controls, but more collections remain. Also, be sure to actually introduce an Insert() method.
The marked items are likely to be the collections where this is relevant: collections where the actual sort order may differ from sort order according to the dictionary key (typically ID).
Revised all use of collections. Made my changes in branch collection-types. If these changes work OK, they need to be implemented in the fdb in order to update the master branch; if they don't, just delete the collection-types branch.
Dictionary<TKey, TValue> maintains the insertion order when enumerating contents, but lacks an Insert method, in other words, there's no way to insert a page control between two existing controls. Note that the order of the controls in the page definition determines that order on the screen, so insertion may be required.
Some collections follow the ID order (e.g. objects), for others the insertion order is more important (e.g. page controls) and may differ from the dictionary key order. Perhaps we could use https://msdn.microsoft.com/en-us/library/system.collections.specialized.ordereddictionary(v=vs.100).aspx, but sadly, it's not generic.
Simple List instead of Dictionary?