Registers a custom comparer for the specified type.
Namespace:
Gallio.FrameworkAssembly: Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)
Syntax
| C# |
|---|
public void Register( Type type, Comparison comparer ) |
| Visual Basic (Declaration) |
|---|
Public Sub Register ( _ type As Type, _ comparer As Comparison _ ) |
Parameters
- type
- Type: System..::.Type
The type for which the custom comparer operates.
- comparer
- Type: Gallio.Common..::.Comparison
A comparer that returns a negative value if the first object represents less that the second object, zero if they represents the same value; or a positive value if the first object represents more than the second object.
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
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | Thrown if type or comparer is null. |
| System..::.InvalidOperationException | Thrown if a custom comparer for the specified type was already registered. |
