private LegActivityMatch(Leg leg, LegEnd legEnd, HandlingActivity handlingActivity, Itinerary itinerary) { Leg = leg; LegEnd = legEnd; HandlingActivity = handlingActivity; Itinerary = itinerary; }
public virtual int CompareTo(LegActivityMatch other) { var thisLegIndex = Itinerary.Legs.ToList().IndexOf(Leg); var otherLegIndex = Itinerary.Legs.ToList().IndexOf(other.Leg); return(thisLegIndex.Equals(otherLegIndex) ? LegEnd.CompareTo(other.LegEnd) : ToPositive(thisLegIndex).CompareTo(ToPositive(otherLegIndex))); }