/// <summary> /// Compares two instances of this object. /// </summary> /// <param name="Timestamped1">A timestamped value.</param> /// <param name="Timestamped2">Another timestamped value.</param> /// <returns>true|false</returns> public static Boolean operator >(Timestamped <T> Timestamped1, Timestamped <T> Timestamped2) { if ((Object)Timestamped1 == null) { throw new ArgumentNullException("The given Timestamped1 must not be null!"); } return(Timestamped1.CompareTo(Timestamped2) > 0); }
/// <summary> /// Compares two instances of this object. /// </summary> /// <param name="Timestamped1">A timestamped value.</param> /// <param name="Timestamped2">Another timestamped value.</param> /// <returns>true|false</returns> public static Boolean operator ==(Timestamped <T> Timestamped1, Timestamped <T> Timestamped2) { // If both are null, or both are same instance, return true. if (Object.ReferenceEquals(Timestamped1, Timestamped2)) { return(true); } // If one is null, but not both, return false. if (((Object)Timestamped1 == null) || ((Object)Timestamped2 == null)) { return(false); } return(Timestamped1.Equals(Timestamped2)); }