Thursday, November 19, 2009

Using Hashtable in 2.0 framework

New warning in .net 2.0 framework. The cumbersome, and difficult to remember case-insensitive comparer declaration for the hashtable has been deprecated.
It tells me to use IEqualityComparer instead.

So, this syntax is obsolete:
New Hashtable(New CaseInsensitiveHashCodeProvider, NewCaseInsensitiveComparer)

So, the replacement seems to:
New Hashtable(StringComparer.OrdinalIgnoreCase)
Related Posts Plugin for WordPress, Blogger...