By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,508 Members | 1,823 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,508 IT Pros & Developers. It's quick & easy.

I need some direction, how to create a collection that allows the following:

P: n/a
dx
I'd appreciate some ideas or direction with a collection issue.

I need to create a custom collection that inherits ICollection, IEnumberable
(need to be able to access by key, index and be able to enumerate) and this
is the kicker...should be able to define the location (index) when inserting
a new item (like arraylist allows.) The real challenge here is being able to
specify the index or where the item will appear when enumerating thru the
collection. I have the rest working by inheriting from
NameObjectCollectionBase.

My problem stems from an object collection I'm using. This collection is
initially instantiated and loaded with items in a specific order. This
object remains in memory, a user can add a new item to the collection after
it is initially loaded. When the user adds a new item (object) to the
collection, the item always appears as the last item when enumerating thru
the collection... which I do not want. I want to be able to specify where
the new item will be placed when enumerating thru this collection.

Is it possible to inherit ArrayList and incorporate the IDictionary
interface? Any ideas on how to do this?

Thanks in advance for any potential help you can provide.

stan

Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"dx" <de*********@yahoo.com> wrote in news:Aa*****************@fe06.lga:
Is it possible to inherit ArrayList and incorporate the IDictionary
interface? Any ideas on how to do this?


Don't one of these classes have an INSERT function? You could do something
similar - allow the user to insert a new element by index.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.