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."); }