Thanks!
"Christoph Nahr" <christoph.nahr@kynosarges.de> wrote in message
news:8sf3b1dj69c3s747tr6tgpa1kt27ereub8@4ax.com...[color=blue]
> On Thu, 16 Jun 2005 12:27:15 -0500, "ESPNSTI"
> <ESPNSTISPAM@Hotmail.com> wrote:
>[color=green]
> >I'm trying to use a generics dictionary with a key class that implements[/color][/color]
and[color=blue][color=green]
> >needs IComparable<>.
> >However when I attempt to use the dictionary, it doesn't appear to use[/color][/color]
the[color=blue][color=green]
> >IComparable<> to find the key.[/color]
>
> Certainly not. Dictionary<> is a hashtable which means it's using
> GetHashCode and Equals from the IEqualityComparer interface to locate
> keys, not IComparable.CompareTo.
>
> The documentation you quote is simply wrong. Apparently someone was
> confusing IComparer with IEqualityComparer. The most recent June CTP
> release of Visual Studio 2005 has the correct documentation.
>
> If you need to use IComparable you should try SortedDictionary or
> SortedList instead. These collections use IComparable to find a key.
> --
>
http://www.kynosarges.de[/color]