Whetstone Class reference
Whetstone Class reference
Whetstone
WhetStone Namespaces
WhetStone.Looping
getMax Class
getMax Methods
GetMax Method
GetMax(T) Method (IEnumerable(T), IComparer(T))
GetMax(T) Method (IEnumerable(T), Int32)
GetMax(T) Method (IEnumerable(T), IComparer(T), Int32)
getMax
GetMax
T
Method (IEnumerable
T
, IComparer
T
, Int32
)
Get the largest element in an
IEnumerable
T
.
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
Copy
public
static
T
GetMax
<T>(
this
IEnumerable
<T>
tosearch
,
IComparer
<T>
compare
,
out
int
index
)
Parameters
tosearch
Type:
System.Collections.Generic
IEnumerable
T
The
IEnumerable
T
to search in.
compare
Type:
System.Collections.Generic
IComparer
T
The
IComparer
T
to find the smallest element.
index
Type:
System
Int32
The index of the largest element.
Type Parameters
T
The type of the elements.
Return Value
Type:
T
The largest element in
tosearch
.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable
T
. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic)
or
Extension Methods (C# Programming Guide)
.
Exceptions
Exception
Condition
ArgumentException
If
tosearch
is empty.
See Also
Reference
getMax Class
GetMax Overload
WhetStone.Looping Namespace