I have a dictionary structure, with multiple key value pairs inside.
myDict.Add(key1, value1);
myDict.Add(key2, value2);
myDict.Add(key3, value3);
>
Don't use a dictionary - there is no guarantee the order of the keys won't change when you add further elements. Instead, define a class Pair
for your Key-Value-Pairs (look here What is C# analog of C++ std::pair? for an example) and use a List
for your datasource. The List
has an Insert
operation you can use to insert new elements anywhere into your list.