Extensibility point for object comparison managed by IComparisonSemantics.

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

Syntax

C#
public class CustomComparers
Visual Basic (Declaration)
Public Class CustomComparers

Remarks

Use the methods Register(Type, Comparison) and Unregister(Type) to add and remove custom type comparers.

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.

Examples

CopyC#
public interface IFoo
{
    int Value
    {
        get;
    }
}

var customComparers = new CustomComparers();
customComparers.Register<IFoo>((x, y) => x.Value.CompareTo(y.Value));

Inheritance Hierarchy

System..::.Object
  Gallio.Framework..::.CustomComparers

See Also