Class ProjectionComparer
Non-generic class to produce instances of the generic class, optionally using type inference.
Namespace: Unity.UIWidgets.Runtime.external
Syntax
public static class ProjectionComparer
Methods
Create<TSource, TKey>(TSource, Func<TSource, TKey>)
Creates an instance of ProjectionComparer using the specified projection. The ignored parameter is solely present to aid type inference.
Declaration
public static ProjectionComparer<TSource, TKey> Create<TSource, TKey>(TSource ignored, Func<TSource, TKey> projection)
Parameters
Type | Name | Description |
---|---|---|
TSource | ignored | Value is ignored - type may be used by type inference |
Func<TSource, TKey> | projection | Projection to use when determining the key of an element |
Returns
Type | Description |
---|---|
ProjectionComparer<TSource, TKey> | A comparer which will compare elements by projecting each element to its key, and comparing keys |
Type Parameters
Name | Description |
---|---|
TSource | Type parameter for the elements to be compared |
TKey | Type parameter for the keys to be compared, after being projected from the elements |
Create<TSource, TKey>(Func<TSource, TKey>)
Creates an instance of ProjectionComparer using the specified projection.
Declaration
public static ProjectionComparer<TSource, TKey> Create<TSource, TKey>(Func<TSource, TKey> projection)
Parameters
Type | Name | Description |
---|---|---|
Func<TSource, TKey> | projection | Projection to use when determining the key of an element |
Returns
Type | Description |
---|---|
ProjectionComparer<TSource, TKey> | A comparer which will compare elements by projecting each element to its key, and comparing keys |
Type Parameters
Name | Description |
---|---|
TSource | Type parameter for the elements to be compared |
TKey | Type parameter for the keys to be compared, after being projected from the elements |