Sorting an Arraylist of Objects?
Posted on 2006-04-04
I have an Array of objects that i am copying to an arraylist.
the object contains a public property called m_CurrentRaceMTP. it's an int.
i need to sort it ascending. i cannot change the object model to implement icomparable because there are other ways one would want to sort this object.
any thoughts? i have found some bubblesort and quicksort algorhythms but i need a bit of hand-holding to get to actually using something like NSort.
here's the code. ideally, i'd like to sort m_Tracks next...
private static ArrayList m_Tracks = new ArrayList();
public void InitForTracks(Program programs)
for(int h=0; h<programs.Length; h++)
if(programs[h].ProgramStatus == ProgramStatus.Unknown || programs[h].ProgramStatus == ProgramStatus.Available || programs[h].ProgramStatus == ProgramStatus.Open)