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