} // 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
示例#5
0
        } // 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