473,395 Members | 1,631 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,395 software developers and data experts.

ISortable

Me
I have a class called Page that contains 2 members, TextObjectArray and
ImageObjectArray as follows:

public class Page
{
public Page(int pageN)
{
//
// TODO: Add constructor lmilogic here
//
pageNumber = pageN;
}

private int pageNumber;
private ArrayList textObjectsArray;
private ArrayList imageObjectsArray;
}

I'll need to come up with a method to sort both TextObjectArray and
ImageObjectArray. I was advised to use ISortable interface. Who can
advise me on how to implement the ISortable interface and to use it for
sorting TextObjectArray and ImageObjectArray? Thanks a bunch?

May 14 '06 #1
2 10453
I'll need to come up with a method to sort both TextObjectArray and
ImageObjectArray. I was advised to use ISortable interface. Who can
advise me on how to implement the ISortable interface and to use it for
sorting TextObjectArray and ImageObjectArray?


There's no standard ISortable interface. Perhaps you mean IComparable?
ArrayList.Sort will use IComparable if the item implements it (and you
don't specify another IComparer).
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
May 15 '06 #2
Thanks Mattias! IComparable is the right answer!

May 17 '06 #3

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

Similar topics

1
by: Mayuresh D via .NET 247 | last post by:
I am trying to get data from a OrderDetails. This data is filtered and obtained by a drop down list that links to the orders table. Here is the code private void...
1
by: saket | last post by:
hello frnds if any one cud help me how to implement the concept of interface and interface objects in c#.net. if its not possible to expalin in mail..plz do send me some link where it is best...
6
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, can someone please explain the advantages of interface-based programming? And then tell me what this is opposed to? thanks, rodchar
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.