This is a collection of objects, so can the value in the value/key pair be a pointer to an object or do I need a more complex class. I found a class called System.Collections.Specialized.NameObjectCollectionBase which seems to do the trick for the keying portion, but am having difficulty getting a for/each to work with that one.
Linda -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED]]On Behalf Of Christoph Schittko Sent: Saturday, August 17, 2002 7:35 PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] using system.collections in .net How about System.Collections.DictionaryBase, but then you always have to provide a key( or generate a unique one if the optional parameter was not specified ). HTH, Christoph Schittko ----- Original Message ----- From: "Axel Heitland" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 17, 2002 4:49 PM Subject: Re: [ADVANCED-DOTNET] using system.collections in .net Have a look at IDictionary ... HTH Axel -----Original Message----- From: Don & Linda [mailto:[EMAIL PROTECTED]] Sent: Freitag, 16. August 2002 21:36 To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] using system.collections in .net I am trying to implement my own collection class for an object in VB by inheriting from System.Collection.CollectionsBase. However, I would like to use a key to insert my objects into the collection. It looks like the add method in the collectionsbase class has only the object as an argument. Is there another class that I can inherit from that does what I need it to do. Ideally, I want to be able to do something like I used to be able to do in vb6: Public Sub Add(objItemToAdd As OrderDetail, _ Optional Key As String = "", _ mCollection.Add objItemToAdd, Key End Sub Thanks in advance, Linda You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.