Computes the maximum value of a view of Int32 values.

Namespace:  C1.LiveLinq
Assembly:  C1.LiveLinq (in C1.LiveLinq.dll)

Syntax

C#
public static AggregationView<int, int> LiveMax(
	this View<int> source
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function LiveMax ( _
	source As View(Of Integer) _
) As AggregationView(Of Integer, Integer)

Parameters

source
Type: C1.LiveLinq.LiveViews..::..View<(Of <(<'Int32>)>)>
A view containing the values to determine the maximum value of.

Return Value

A view representing the maximum of the values.

Remarks

If the source is empty or contains only nulls, an InvalidOperationException is thrown.

It is possible to use standard LINQ query operator Max instead of LiveMax. Both are "live" in the sense that they are recomputed automatically when any change occurs in the source. The difference is that Max will every time loop through the entire source collection and aggregate it from scratch, whereas LiveMax will use a more performant algorithm, will maintain its value incrementally, processing only those source items that actually changed.

See Also