Home All Groups Group Topic Archive Search About
Author
6 Jan 2006 9:13 PM
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!

Author
6 Jan 2006 9:58 PM
Kerry Moorman
Mike,

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

Kerry Moorman


Show quoteHide quote
"Mike" wrote:

> 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!
>
>
>
Author
7 Jan 2006 12:48 AM
Herfried K. Wagner [MVP]
"Kerry Moorman" <KerryMoor***@discussions.microsoft.com> schrieb:
> 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 S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
8 Jan 2006 10:14 AM
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]




Show quoteHide quote
"Mike" <m***@hitnext.com> wrote in message
news:uRn89XwEGHA.1288@TK2MSFTNGP09.phx.gbl...
> 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!
>
>