B
Beorne
I have to retrieve the first kei I have inserted in a
Dictionary<int,int> called dict.
The only method I found is:
Dictionary<int,int>.KeyCollection.Enumerator dke =
dict.Keys.GetEnumerator();
dke.MoveNext();
int first = dke.Current;
That seems a little convoluted, is there a more elegant way?
And, more importantly, can I be sure that this method retrieves the
first inserted key?
Note: I can't use SortedDictionary because I'm working on compact
framework.
Thanks
Dictionary<int,int> called dict.
The only method I found is:
Dictionary<int,int>.KeyCollection.Enumerator dke =
dict.Keys.GetEnumerator();
dke.MoveNext();
int first = dke.Current;
That seems a little convoluted, is there a more elegant way?
And, more importantly, can I be sure that this method retrieves the
first inserted key?
Note: I can't use SortedDictionary because I'm working on compact
framework.
Thanks