473,473 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is there a generic type that is similar to the VB6 'Collection' object?

Specifically, I would like a Generic dynamic list that supports
referencing items by Index and by Key. I've looked at List(of T),
System.Collections.Generic.Dictionary(of Key, Value) and others but
don't see anything that fits the bill.

I thought I'd read about an object called a "KeyedCollection" but I
can't find any information on it.

Anyone have a suggestion? Of course, I can build my own, but it'd
sure be nice to have something already built and tested that I can
just inherit to add my own additional bells and whistles.

Thanks so much.
-Jason Kendall
Ja**********@hotmail.com
Nov 21 '05 #1
2 1228
Jason,
I would recommend System.Collections.ObjectModel.KeyedCollection(Of K, T).

http://msdn2.microsoft.com/library/m...us,vs.80).aspx
NOTE: There are VS 2005 specific forums available at:

http://forums.microsoft.com/msdn/

Hope this helps
Jay

"Jason Kendall" <Ja**********@hotmail.com> wrote in message
news:n0********************************@4ax.com...
| Specifically, I would like a Generic dynamic list that supports
| referencing items by Index and by Key. I've looked at List(of T),
| System.Collections.Generic.Dictionary(of Key, Value) and others but
| don't see anything that fits the bill.
|
| I thought I'd read about an object called a "KeyedCollection" but I
| can't find any information on it.
|
| Anyone have a suggestion? Of course, I can build my own, but it'd
| sure be nice to have something already built and tested that I can
| just inherit to add my own additional bells and whistles.
|
| Thanks so much.
|
|
| -Jason Kendall
| Ja**********@hotmail.com
Nov 21 '05 #2
Jay,

I feel so retarded. There's a ton of information out there for the
KeyedCollection you describe. I cannot imagine how I missed it unless
I just mistyped and was too dumb to notice. Thanks for not pointing
out how silly my question must have seemed.

"NOTE: There are VS 2005 specific forums available at:"

Thanks!

On Tue, 5 Jul 2005 13:20:06 -0500, "Jay B. Harlow [MVP - Outlook]"
<Ja************@msn.com> wrote:
Jason,
I would recommend System.Collections.ObjectModel.KeyedCollection(Of K, T).

http://msdn2.microsoft.com/library/m...us,vs.80).aspx
NOTE: There are VS 2005 specific forums available at:

http://forums.microsoft.com/msdn/

Hope this helps
Jay

"Jason Kendall" <Ja**********@hotmail.com> wrote in message
news:n0********************************@4ax.com.. .
| Specifically, I would like a Generic dynamic list that supports
| referencing items by Index and by Key. I've looked at List(of T),
| System.Collections.Generic.Dictionary(of Key, Value) and others but
| don't see anything that fits the bill.
|
| I thought I'd read about an object called a "KeyedCollection" but I
| can't find any information on it.
|
| Anyone have a suggestion? Of course, I can build my own, but it'd
| sure be nice to have something already built and tested that I can
| just inherit to add my own additional bells and whistles.
|
| Thanks so much.
|
|
| -Jason Kendall
| Ja**********@hotmail.com


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
7
by: Paul Welter | last post by:
Is there anyway to do the following? Type myType = typeof(User); Collection<myType> list = new Collection<myType>(); I know I could just use User instead of myType but have a function that...
5
by: cody | last post by:
I know I can use ArrayList.ReadOnly() to create a readonly version of it, but how can I achive a similar thing with a generic collection of .NET 2.0?
8
by: JAL | last post by:
Here is my first attempt at a deterministic collection using Generics, apologies for C#. I will try to convert to C++/cli. using System; using System.Collections.Generic; using System.Text; ...
2
by: AdawayNoSpam | last post by:
Said that I have the following class Class MyRootClass(Of T) End Class Class MySubClass1(Of T) Inherits MyRootClass(Of T) End Class
0
by: crazyone | last post by:
I've got a gaming framework i'm building and i want to save myself the trouble of reading and writting the complete game data to a custom file and load/save it to an XML file but i'm getting...
2
by: Angel Mateos | last post by:
I have this structure: Class ElemBase Class Elem1 : Inherits ElemBase Class ColecBase(Of GenElem As {ElemBase, New}) : Inherits System.ComponentModel.BindingList(Of GenElem) Class Colec1...
5
by: Ethan Strauss | last post by:
Hi, I have just started using Generic Collections for .Net 2.0 and so far they are working very nicely for me. But, I do have a couple of questions. If I have a Generic collection which has a type...
10
by: fig000 | last post by:
HI, I'm new to generics. I've written a simple class to which I'm passing a generic list. I'm able to pass the list and even pass the type of the list so I can use it to traverse it. It's a...
2
by: SimonDotException | last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.