June 2003
Intermediate to advanced
800 pages
34h 20m
English
You need to create a key-based collection that can only contain one type of object and rejects attempts to add other data types.
Create a custom dictionary collection class by deriving from System. Collections.DictionaryBase, and implement type-safe Add, Remove, and Item methods.
With a custom dictionary collection, you can place restrictions on the type of objects stored in the collection and on the type of object used to index items in the collection. Internally, the DictionaryBase object uses an ordinary weakly typed Hashtable, which is exposed through the protected property Dictionary. However, external code can’t directly access this collection. Instead, it must use one ...
Read now
Unlock full access