Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.CustomEqualityComparer<T>

Summary

Encapsulates an IEqualityComparer<T> that uses an equality comparison function provided as a delegate.

Generic type parameters

T The type of elements to be compared for equality.

Constructors

CustomEqualityComparer<T>(Func<T, T, bool> comparison, Func<T, int> getHashCode)
Constructor.
CustomEqualityComparer<T>(Func<T, T, bool> comparison)
Constructor which re-uses the default hash function. Use this overload only if using the objects’ original hash function is appropriate for this equality comparison.

Static methods

CustomEqualityComparer<T>
By(Func<T, string> selector, bool ignoreCase)
Creates and returns an equality comparer that compares the equality of objects by comparing the equality of the result of a string selector function.
CustomEqualityComparer<T>
By<TBy>(Func<T, TBy> selector, IEqualityComparer<TBy> comparer)
Creates and returns an equality comparer that compares the equality of objects by comparing the equality of the result of a selector function.
CustomEqualityComparer<T>
By<TBy>(Func<T, TBy> selector, Func<TBy, TBy, bool> comparison = null, Func<TBy, int> getHashCode = null)

Instance methods

bool
Equals(T x, T y)
  • Implements: IEqualityComparer<T>.Equals(T, T)
Compares two elements for equality. (see also remarks)
int
  • Implements: IEqualityComparer<T>.GetHashCode(T)
Returns a hash code for an element. (see also remarks)