Collection

M

Mike

Hi guys;

I created a class that inherits from DictionaryBase class.
The thing is that I want to allow the user when using my class to enter
duplicate keys in the collection like;

Dim myCl as new MyDictionary
myCl.Dictionary.Add("Mike", AnObject)
myCl.Dictionary.Add("Mike", AnObject2)
myCl.Dictionary.Add("Mike", AnObject3)

how can I achieve this inhering from DictionaryBase?

Thanks guys!
 
G

Guest

Mike,

I think that all of the .Net key-value collections require unique, non-null
keys.

Kerry Moorman
 
H

Herfried K. Wagner [MVP]

Kerry Moorman said:
I think that all of the .Net key-value collections require unique,
non-null
keys.

Exception: The 'NamedValueCollection' which store all values for a certain
key in a single string. However, this is not a very flexible solution.
 
M

m.posseth

maybe i am thinking to simplistic here :)

but why don`t you just add the objects to a object array and store them
under one name in the dictionary

regards

Michel Posseth [MCP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top