?
=?iso-8859-1?Q?Ti=EBsto?=
Hi guys, I've trying to find a collection for a very common task without any luck.
I only need a collection of Key/Value objects, cause I need to check whether a key as been added and if not, get it in.
I thought a HashTable would be enough. The problem with HashTable and with SortedList is that they really "re-sort" the elements when a new element gets into the collection. So, when I loop throught the collection using a foreach or a GetEnumerator, the elements appear in a different order. I Don't want this to happen. I want to read the elements in the same order I created them. But I still need the "key search" functionally. I don't want to create a special class for this, I'm sure this is a quite simple task.
Thanks in advance.
I only need a collection of Key/Value objects, cause I need to check whether a key as been added and if not, get it in.
I thought a HashTable would be enough. The problem with HashTable and with SortedList is that they really "re-sort" the elements when a new element gets into the collection. So, when I loop throught the collection using a foreach or a GetEnumerator, the elements appear in a different order. I Don't want this to happen. I want to read the elements in the same order I created them. But I still need the "key search" functionally. I don't want to create a special class for this, I'm sure this is a quite simple task.
Thanks in advance.