I made a list of BaseLines form multiple corridors and I need to sort this list by Alignment and Profile.
So all BaseLines with the same Alignment and Profile to be consecutive in my list.
Is the sorting correct?
List<Baseline> blList = new List<Baseline>();
foreach (Corridor Cor in multipleCorridors)
{
for (int i = 0; i < Cor.Baselines.Count; i++)
{
blList.Add(Cor.Baselines[i]);
}
}
blList.Sort(delegate (Baseline x, Baseline y)
{
int a;
a = x.AlignmentId.CompareTo(y.AlignmentId);
if (a == 0)
{
a = x.ProfileId.CompareTo(y.ProfileId);
}
return a;
});
Solved! Go to Solution.
Solved by _gile. Go to Solution.
Can't find what you're looking for? Ask the community or share your knowledge.