/// <summary> /// Initializes a new instance of <see cref="DelegateEqualityComparer{T}" /> class. /// </summary> /// <param name="getHashCodeHandler"> /// The optional logic for <see cref="DelegateEqualityComparer{T}.GetHashCode(T)" />. /// </param> /// <remarks> /// If <paramref name="getHashCodeHandler" /> is <see langword="null" />, default /// logic from <see cref="EqualityComparer{T}.Default" /> will be used. /// Default logic for <see cref="DelegateEqualityComparer{T}.Equals(T, T)" /> will be used here. /// </remarks> public DelegateEqualityComparer(GetHashCodeHandler getHashCodeHandler) : this(null, getHashCodeHandler) { }
/// <summary> /// Initializes a new instance of <see cref="DelegateEqualityComparer{T}" /> class. /// </summary> /// <param name="equalsHandler"> /// The optional logic for <see cref="DelegateEqualityComparer{T}.Equals(T, T)" />. /// </param> /// <param name="getHashCodeHandler"> /// The optional logic for <see cref="DelegateEqualityComparer{T}.GetHashCode(T)" />. /// </param> /// <remarks> /// If <paramref name="equalsHandler" /> and/or <paramref name="getHashCodeHandler" /> are <see langword="null" />, default /// logic from <see cref="EqualityComparer{T}.Default" /> will be used. /// </remarks> public DelegateEqualityComparer(EqualsHandler equalsHandler, GetHashCodeHandler getHashCodeHandler) { this._EQUALS = equalsHandler ?? EqualityComparer <T> .Default.Equals; this._GET_HASH_CODE = getHashCodeHandler ?? EqualityComparer <T> .Default.GetHashCode; }