Connecting Tech Pros Worldwide Forums | Help | Site Map

Key-Value pair list - not sorted

Sehboo
Guest
 
Posts: n/a
#1: Mar 22 '07
I am trying to use key value pair list, but I don't want to use sorted
list because it messes up my order. I am not sure what other options
I have. Can anybody point?

Thanks


Marc Gravell
Guest
 
Posts: n/a
#2: Mar 22 '07

re: Key-Value pair list - not sorted


How about List<KeyValuePair<TKey,TValue>>?

Marc


burke.anthony.j@gmail.com
Guest
 
Posts: n/a
#3: Mar 22 '07

re: Key-Value pair list - not sorted


On Mar 22, 10:57 am, "Sehboo" <MasoodAd...@gmail.comwrote:
Quote:
I am trying to use key value pair list, but I don't want to use sorted
list because it messes up my order. I am not sure what other options
I have. Can anybody point?
>
Thanks
If you have a specific order of key value pairs you want to store, you
could use the generic list structure with key value pairs in it:

System.Collections.Generic.List<System.Collections .Generic.KeyValuePair<TKey,
TValue>>

But if you are trying to store them in a certain order, then it sounds
like you probably shouldn't be using key value pairs, but instead use
a struct that unites the two. The point of key value pairs is to look
them up by their key.

Closed Thread