Click or drag to resize
AlgorithmsMaximumT Method (IEnumerableT, ComparisonT)
Finds the maximum value in a collection. A supplied Comparison<T> delegate is used to compare the items in the collection.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static T Maximum<T>(
	IEnumerable<T> collection,
	Comparison<T> comparison
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection to search.
comparison
Type: SystemComparisonT
The comparison used to compare items in the collection.

Type Parameters

T
The type of items in the collection.

Return Value

Type: T
The largest item in the collection.
Exceptions
ExceptionCondition
InvalidOperationExceptionThe collection is empty.
ArgumentNullExceptioncollection or comparison is null.
See Also