public int CompareTo(Period other) { if (StartTime.Equals(other.StartTime)) { return(0); } if (StartTime.LessThan(other.StartTime)) { return(-1); } if (StartTime.GreaterThan(other.StartTime)) { return(1); } throw new Exception("An error occurred while comparing two Periods."); }
public int CompareTo(IPeriod p) { if (p == null) { throw new ArgumentNullException("p"); } else if (Equals(p)) { return(0); } else if (StartTime.LessThan(p.StartTime)) { return(-1); } else if (StartTime.GreaterThanOrEqual(p.StartTime)) { return(1); } throw new Exception("An error occurred while comparing Period values."); }