Registers a custom equality comparer for the specified type.

Namespace:  Gallio.Framework
Assembly:  Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public void Register(
	Type type,
	EqualityComparison equalityComparer
)
Visual Basic (Declaration)
Public Sub Register ( _
	type As Type, _
	equalityComparer As EqualityComparison _
)

Parameters

type
Type: System..::.Type
The type for which the custom comparer operates.
equalityComparer
Type: Gallio.Common..::.EqualityComparison
An equality comparer that returns true is the objects are equivalent; false otherwise.

Remarks

The Gallio inner comparison engine handles with the case of null objects comparison prior to the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the objects to compare are never null.

Exceptions

ExceptionCondition
System..::.ArgumentNullExceptionThrown if type or equalityComparer is null.
System..::.InvalidOperationExceptionThrown if a custom comparer for the specified type was already registered.

See Also