467,135 Members | 1,123 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,135 developers. It's quick & easy.

Collection wrapper

ArrayList suffers from the same effect as the vb6 collection object.
Once you add an object to the collection, you lose the intellisense for
that object. Has anyone seen any wrappers for the collection-like
objects in .NET that preserve intellisense?

Thanks
Nov 15 '05 #1
  • viewed: 2672
Share:
6 Replies
Hi Frank,

Check out free utility CodesSmith
http://www.ericjsmith.net/codesmith/

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

"Frank Rizzo" <no****@nospam.com> wrote in message
news:Oq**************@TK2MSFTNGP11.phx.gbl...
ArrayList suffers from the same effect as the vb6 collection object.
Once you add an object to the collection, you lose the intellisense for
that object. Has anyone seen any wrappers for the collection-like
objects in .NET that preserve intellisense?

Thanks

Nov 15 '05 #2
Ah, and if you want to use normal ArrayList - just typecast the items to
your class.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

"Frank Rizzo" <no****@nospam.com> wrote in message
news:Oq**************@TK2MSFTNGP11.phx.gbl...
ArrayList suffers from the same effect as the vb6 collection object.
Once you add an object to the collection, you lose the intellisense for
that object. Has anyone seen any wrappers for the collection-like
objects in .NET that preserve intellisense?

Thanks

Nov 15 '05 #3
Frank,
Have you looked at the System.Collections.CollectionBase base class?

It allows you to define a type safe collection that is based on an
underlying ArrayList. A type safe collection among other things enables
intellisense.

Of course you need to manually create the collections, however there are
tools available that will automate the creation of the type safe
collections, such as the one Miha Markic pointed out.

Note there is also a System.Collections.DitionaryBase if you want a type
safe collection based on an underlying HashTable.

Note: when C# 2.0 (Whidbey, aka VS.NET 2004) ships later in 2004, we will
have Generics which will simplify creating type safe collections.

Hope this helps
Jay

"Frank Rizzo" <no****@nospam.com> wrote in message
news:Oq**************@TK2MSFTNGP11.phx.gbl...
ArrayList suffers from the same effect as the vb6 collection object.
Once you add an object to the collection, you lose the intellisense for
that object. Has anyone seen any wrappers for the collection-like
objects in .NET that preserve intellisense?

Thanks

Nov 15 '05 #4
Thank you both. This clears a few things up.

Jay B. Harlow [MVP - Outlook] wrote:
Frank,
Have you looked at the System.Collections.CollectionBase base class?

It allows you to define a type safe collection that is based on an
underlying ArrayList. A type safe collection among other things enables
intellisense.

Of course you need to manually create the collections, however there are
tools available that will automate the creation of the type safe
collections, such as the one Miha Markic pointed out.

Note there is also a System.Collections.DitionaryBase if you want a type
safe collection based on an underlying HashTable.

Note: when C# 2.0 (Whidbey, aka VS.NET 2004) ships later in 2004, we will
have Generics which will simplify creating type safe collections.

Hope this helps
Jay

"Frank Rizzo" <no****@nospam.com> wrote in message
news:Oq**************@TK2MSFTNGP11.phx.gbl...
ArrayList suffers from the same effect as the vb6 collection object.
Once you add an object to the collection, you lose the intellisense for
that object. Has anyone seen any wrappers for the collection-like
objects in .NET that preserve intellisense?

Thanks


Nov 15 '05 #5
You'll be happy to know that C# 2.0 should solve this "problem" with
Generics. I'm not sure how well the intellisense will work, but I assume MS
will do a good job with it.

You'll just define ArrayList<Customer> and you have an ArrayList that only
holds Customers. Of course, if you are writing some sort of library, then a
custom collection is still the way to go.

I'm sure that hearing this'll just make you become as impatient as
I...waiting for generics. I'm almost drooling, I am.

--Matthew W. Jackson

"Frank Rizzo" <no****@nospam.com> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
Thank you both. This clears a few things up.

Jay B. Harlow [MVP - Outlook] wrote:

Nov 15 '05 #6
I'm sure that hearing this'll just make you become as impatient as
I...waiting for generics. I'm almost drooling, I am.


Well, make sure to keep enough water (beer?) in the house - as it is
probably a year away ;-)

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
Nov 15 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

36 posts views Thread by André | last post: by
reply views Thread by Jeff Haumesser | last post: by
6 posts views Thread by rodchar | last post: by
18 posts views Thread by Larry Herbinaux | last post: by
19 posts views Thread by Jamey Shuemaker | last post: by
28 posts views Thread by Michael Primeaux | last post: by
5 posts views Thread by Mike Surcouf | last post: by
5 posts views Thread by pamela fluente | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.