Click or drag to resize
EnumerableExScanTSource, TAccumulate Method (IEnumerableTSource, TAccumulate, FuncTAccumulate, TSource, TAccumulate)
Generates a sequence of accumulated values by scanning the source sequence and applying an accumulator function.

Namespace: System.Linq
Assembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntax
C#
public static IEnumerable<TAccumulate> Scan<TSource, TAccumulate>(
	this IEnumerable<TSource> source,
	TAccumulate seed,
	Func<TAccumulate, TSource, TAccumulate> accumulator
)

Parameters

source
Type: System.Collections.GenericIEnumerableTSource
Source sequence.
seed
Type: TAccumulate
Accumulator seed value.
accumulator
Type: SystemFuncTAccumulate, TSource, TAccumulate
Accumulation function to apply to the current accumulation value and each element of the sequence.

Type Parameters

TSource
Source sequence element type.
TAccumulate
Accumulation type.

Return Value

Type: IEnumerableTAccumulate
Sequence with all intermediate accumulation values resulting from scanning the sequence.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTSource. 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).
See Also