i think you want to define a comparison function where you can determine rank between any 2 items in the list.
int CompareObject1(Object1 left, Object1 right)
{
// TODO: cases where your items are null
// compare Property1 values
if (left.Property1)
{
if (right.Property1)
{
// items at same rank
return 0;
}
else
{
// left item is higher rank than right
return -1;
}
}
else if (right.Property1)
{
// right item is higher rank than left
return 1;
}
// Property1 doesn't indicate position, move along
// TODO: repeat for Property2
// Property2 doesn't indicate position, move along
// TODO: repeat for Property3
// if we get here, no determination can
// be made/don't bother to move anything
return 0;
}
the return value indicates if the left or right object should be ranked higher with -1 or 1 (or 0 for preference). just make sure you cover all your conditions.
then you can use this like
List<Object1> foo = new List<Object1>() { <items...> };
foo.Sort(CompareObject1);
if you're list ends up backwards, i probably flipped the signs in the compare function. your rules for sorting are contradictory so i'll let you sort Property2 and Property3.