/// <summary> /// Returns a hash code for the specified object. /// </summary> /// <returns> /// A hash code for the specified object. /// </returns> /// <param name="obj">The <see cref="T:System.Object" /> for which a hash code is to be returned.</param> /// <exception cref="T:System.ArgumentNullException"> /// The type of <paramref name="obj" /> is a reference type and /// <paramref name="obj" /> is null. /// </exception> public int GetHashCode(BadKey <T> obj) { if (obj == null) { return(0); } if (obj.Key == null) { return(0); } return(obj.Key.GetHashCode()); }
/// <summary> /// Determines whether the specified objects are equal. /// </summary> /// <returns> /// true if the specified objects are equal; otherwise, false. /// </returns> /// <param name="x">The first object of type <paramref name="T" /> to compare.</param> /// <param name="y">The second object of type <paramref name="T" /> to compare.</param> public bool Equals(BadKey <T> x, BadKey <T> y) { if (x == null) { return(y == null); } if (y == null) { return(false); } if (x.Key == null) { return(y.Key == null); } return(x.Key.Equals(y.Key)); }
/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <returns> /// true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false. /// </returns> /// <param name="other">An object to compare with this object.</param> public bool Equals(BadKey <T> other) { return(true); }
/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <returns> /// A value that indicates the relative order of the objects being compared. The return value has the following /// meanings: Value Meaning Less than zero This object is less than the <paramref name="other" /> parameter.Zero This /// object is equal to <paramref name="other" />. Greater than zero This object is greater than /// <paramref name="other" />. /// </returns> /// <param name="other">An object to compare with this object.</param> public int CompareTo(BadKey <T> other) { return(0); }