EnumerableExScanTSource Method (IEnumerableTSource, FuncTSource, TSource, TSource) |
Generates a sequence of accumulated values by scanning the source sequence and applying an accumulator function.
Namespace: System.LinqAssembly: System.Interactive (in System.Interactive.dll) Version: 1.2.0.0
Syntaxpublic static IEnumerable<TSource> Scan<TSource>(
this IEnumerable<TSource> source,
Func<TSource, TSource, TSource> accumulator
)
Parameters
- source
- Type: System.Collections.GenericIEnumerableTSource
Source sequence. - accumulator
- Type: SystemFuncTSource, TSource, TSource
Accumulation function to apply to the current accumulation value and each element of the sequence.
Type Parameters
- TSource
- Source sequence element type.
Return Value
Type:
IEnumerableTSourceSequence 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