471,330 Members | 1,508 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

CollectionBase and sorting

Hello!

I'm reading a book and here I have found something that sounds strange.
It says the following:
"Note that some classes in the System.Collection namespace, including
CollectionBase, don't
expose a method for sorting. If you want to sort a collection you have
derived from this class you''ll
have to put a bit more work in and sort the internal List collection
youself."

So assume I have derived a class from this CollectionBase I can use either
the List or InnerList to sort by objects
that is implementing either CompareTo or Compare.

My question is what exactly do they mean in the text above with "you''ll
have to put a bit more work in and sort the internal List collection
youself."

//Tony


Jun 27 '08 #1
1 5551
Indeed it looks like you should be able to just use InnerList.Sort() -
although note that I would recommend using the generic classes like
List<Tand Collection<Tin place of the 1.1 CollectionBase...

Marc
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by m. pollack | last post: by
2 posts views Thread by m.pollack | last post: by
5 posts views Thread by Eric Johannsen | last post: by
2 posts views Thread by Samuel R. Neff | last post: by
3 posts views Thread by Tony Johansson | last post: by

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.