/// <summary> /// Returns the result of comparing this instance to another <b>Time</b> /// instance. /// </summary> /// <param name="other">The other <b>Time</b> instance to compare with.</param> /// <returns>An integer value indicating the relative ordering.</returns> public int CompareTo(Time other) { if ((timeZone == null) && (other.timeZone == null)) { return(timeValue.CompareTo(other.timeValue)); } else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals(other.timeZone)) { return(timeValue.CompareTo(other.timeValue)); } else { return(ToDateTime().CompareTo(other.ToDateTime())); } }
/// <summary> /// Determines if the <b>Time</b> instance and another hold the same value. /// </summary> /// <param name="other">The <see cref="Time"/> to compare with.</param> /// <returns><b>true</b> if both instances are times and represent the /// same value, <b>false</b> otherwise.</returns> public bool Equals(Time other) { if ((timeZone == null) && (other.timeZone == null)) { return(timeValue.Equals(other.timeValue)); } else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals(other.timeZone)) { return(timeValue.Equals(other.timeValue)); } else { return(ToDateTime().Equals(other.ToDateTime())); } }
/// <summary> /// Determines if the <b>Time</b> instance and another hold the same value. /// </summary> /// <param name="other">The <see cref="Time"/> to compare with.</param> /// <returns><b>true</b> if both instances are times and represent the /// same value, <b>false</b> otherwise.</returns> public bool Equals(Time other) { if ((timeZone == null) && (other.timeZone == null)) return (timeValue.Equals (other.timeValue)); else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone)) return (timeValue.Equals (other.timeValue)); else return (ToDateTime ().Equals (other.ToDateTime ())); }
/// <summary> /// Returns the result of comparing this instance to another <b>Time</b> /// instance. /// </summary> /// <param name="other">The other <b>Time</b> instance to compare with.</param> /// <returns>An integer value indicating the relative ordering.</returns> public int CompareTo(Time other) { if ((timeZone == null) && (other.timeZone == null)) return (timeValue.CompareTo (other.timeValue)); else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone)) return (timeValue.CompareTo (other.timeValue)); else return (ToDateTime ().CompareTo (other.ToDateTime ())); }