SortedList<T> missing GetByIndex method?

B

Bruce Wood

Sorry if this is a repost. My original post appears to have
disappeared.

Is it just me, or is the generic SortedList<T> missing a GetByIndex
method. The old (non-generic) SortedList has a method that, given an
index into the sorted list, will return the value of the item at that
index.

The new SortedList<T> has methods to get the index into the list of a
value, and another methdo to get the index into the list of a key
(just as SortedList had). However, there appears to be no method that
allows you to use that index for anything.

Was this an oversight? Or perhaps it was a conscious decision on the
part of the framework designers? Or have I missed something?
 
P

Peter Duniho

Sorry if this is a repost. My original post appears to have
disappeared.

Your original post did make it, and I answered it. You should be able to
see it in your newsreader, but if you can't and aren't able to figure out
how to fix your newsreader to show it, I recommend using Google Groups as
a better alternative to starting a whole new thread, at least for the
purpose of finding your original post and any possible replies.
 
B

Bruce Wood

Your original post did make it, and I answered it. You should be able to
see it in your newsreader, but if you can't and aren't able to figure out
how to fix your newsreader to show it, I recommend using Google Groups as
a better alternative to starting a whole new thread, at least for the
purpose of finding your original post and any possible replies.

Thanks. I can now (strangely) see my original post and your reply.

I do use Google Groups, but for some reason when I logged in a day
after my original post, I couldn't see it, and couldn't find it when I
searched for it. Now I can. Weird.

Thank you again for your answer. I wouldn't have thought of indexing
into the Values array.
 
J

Jon Skeet [C# MVP]

Bruce Wood said:
Thanks. I can now (strangely) see my original post and your reply.

I do use Google Groups, but for some reason when I logged in a day
after my original post, I couldn't see it, and couldn't find it when I
searched for it. Now I can. Weird.

Google groups had an odd couple of days last week - they were about a
day behind for a while. Seems to be okay now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top