M
Mark
I want to create a collection class that will be strongly typed (store a
specific object type), be keyed with a case insensitive string, and be able
to access objects stored by index, or sequentially (in the order stored) via
"For Each".
I know I could code this from scratch - or derived from a number of
framework classes, but I'm not sure of the pros/cons of various
possibilities.
I'd like to use some of the new Generics - they are sweet, but there is no
generic collection - they have dictionaries, lists, sorted list, etc.
Perhaps I can add a HashTable to a basic (derived) collection class.
But now I see this CollectionsUtil class, which has a
CreateCaseInsensitiveHashtable method. The docs on it are a bit sparse, no
usage examples. Can this be used with existing collection or dictionary
classes? If I had to, I could give up the indexed access requirement - and I
guess all of the collection classes provide enumerators so For Each and
foreach can be used (although with dictionaries, you are iterating over
DictionaryEntry items, not the stored objects).
I'd appreciate any advice/comments.
Thanks
specific object type), be keyed with a case insensitive string, and be able
to access objects stored by index, or sequentially (in the order stored) via
"For Each".
I know I could code this from scratch - or derived from a number of
framework classes, but I'm not sure of the pros/cons of various
possibilities.
I'd like to use some of the new Generics - they are sweet, but there is no
generic collection - they have dictionaries, lists, sorted list, etc.
Perhaps I can add a HashTable to a basic (derived) collection class.
But now I see this CollectionsUtil class, which has a
CreateCaseInsensitiveHashtable method. The docs on it are a bit sparse, no
usage examples. Can this be used with existing collection or dictionary
classes? If I had to, I could give up the indexed access requirement - and I
guess all of the collection classes provide enumerators so For Each and
foreach can be used (although with dictionaries, you are iterating over
DictionaryEntry items, not the stored objects).
I'd appreciate any advice/comments.
Thanks