473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
6 2847
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James S | last post by:
Hi, Basically I've been fighting with this code for a few days now and can't seem to work around this problem. Included is the output, the program I use to get this error and the source code for...
1
by: JC | last post by:
How does garbage collection work in C# and VB.NET for data returned from COM object? For example, a COM object written in C++ returns a SAFEARRAY to C# or VB.NET, will this SAFEARRAY (mapped to...
36
by: André | last post by:
Hello, I have a c# application that creates a timer to fire every minute using multithreading. On every minute it calls a Ping class that I made using sockets. It creates a new ping class then...
0
by: Jeff Haumesser | last post by:
Hi ! I've looked at the MS Article "Sorting the Unsortable Collection" in msdn and it works great. It is a class called a SortedView that is a wrapper for my collection, allowing sorting...
6
by: rodchar | last post by:
hey all, Dim _oItems As Outlook.Items Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) _oItems = oInbox.Items I can iterate thru this with a...
18
by: Larry Herbinaux | last post by:
I'm having issues with garbage collection with my long-standing service process. If you could review and point me in the right direction it would be of great help. If there are any helpful...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
28
by: Michael Primeaux | last post by:
What is the recommended pattern for implementing a synchronized (thread-safe) class that inherits from Collection<T>? For example, I want to implement a SyncRoot property . I do see where I can...
5
by: Mike Surcouf | last post by:
Hi All I have a stored procedure wrapper that returns Collection<T>. The wrapper is generated by codesmith so I don't really want to start altering it. I need to use this collection in a...
5
by: pamela fluente | last post by:
I have been posting this question with no success. I do not know if I am not being clear of the question is too difficult :-)) or unclear. It seems to me that the need to wrap a collection is quite...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.