Tuesday, January 8, 2008

HybridDictionary Class

Implements IDictionary by using a ListDictionary while the collection is small, and then switching to a Hashtable when the collection gets large.


This class is recommended for cases where the number of elements in a dictionary is unknown. It takes advantage of the improved performance of a ListDictionary with small collections, and offers the flexibility of switching to a Hashtable which handles larger collections better than ListDictionary.

Thread Safety

Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Reference: http://msdn2.microsoft.com/en-us/library/system.collections.specialized.hybriddictionary.aspx

No comments: