} // SortBy // ---------------------------------------------------------------------- public virtual void SortReverseBy(ITimePeriodComparer comparer) { if (comparer == null) { throw new ArgumentNullException("comparer"); } SortBy(new TimePeriodReversComparer(comparer)); } // SortReverseBy
} // Move // ---------------------------------------------------------------------- public virtual void SortBy(ITimePeriodComparer comparer) { if (comparer == null) { throw new ArgumentNullException("comparer"); } periods.Sort(comparer); } // SortBy
} // GetRelation // ---------------------------------------------------------------------- public virtual int CompareTo(ITimePeriod other, ITimePeriodComparer comparer) { if (other == null) { throw new ArgumentNullException("other"); } if (comparer == null) { throw new ArgumentNullException("comparer"); } return(comparer.Compare(this, other)); } // CompareTo
// ---------------------------------------------------------------------- public TimePeriodReversComparer(ITimePeriodComparer baseComparer) { this.baseComparer = baseComparer; } // TimePeriodReversComparer
} // GetRelation // ---------------------------------------------------------------------- public virtual int CompareTo(ITimePeriod other, ITimePeriodComparer comparer) { CommonMethods.checkNull(other, "other @ CompareTo"); CommonMethods.checkNull(comparer, "comparer @ CompareTo"); return(comparer.Compare(this, other)); } // CompareTo