/// <summary> /// Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. /// </summary> /// <param name="source">An <see cref="IBindableCollection{TElement}" /> to aggregate over.</param> /// <param name="seed">The initial accumulator value.</param> /// <param name="func">An accumulator function to be invoked on each element.</param> /// <param name="resultSelector">A function to transform the final accumulator value into the result value.</param> /// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam> /// <typeparam name="TAccumulate">The type of the accumulator value.</typeparam> /// <typeparam name="TResult">The type of the resulting value.</typeparam> /// <returns>The transformed final accumulator value.</returns> public static IBindable <TResult> Aggregate <TSource, TAccumulate, TResult>(this IBindableCollection <TSource> source, TAccumulate seed, Expression <Func <TAccumulate, TSource, TAccumulate> > func, Expression <Func <TAccumulate, TResult> > resultSelector) { return(source.Aggregate(seed, func, resultSelector, DefaultDependencyAnalysis)); }
/// <summary> /// Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. /// </summary> /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam> /// <typeparam name="TAccumulate">The type of the accumulator value.</typeparam> /// <typeparam name="TResult">The type of the resulting value.</typeparam> /// <param name="source">An <see cref="IBindableCollection{TElement}"/> to aggregate over.</param> /// <param name="seed">The initial accumulator value.</param> /// <param name="func">An accumulator function to be invoked on each element.</param> /// <param name="resultSelector">A function to transform the final accumulator value into the result value.</param> /// <param name="dependencyAnalysisMode">The dependency analysis mode.</param> /// <returns>The transformed final accumulator value.</returns> public static IBindable <TResult> Aggregate <TSource, TAccumulate, TResult>(this IBindableCollection <TSource> source, TAccumulate seed, Expression <Func <TAccumulate, TSource, TAccumulate> > func, Expression <Func <TAccumulate, TResult> > resultSelector, DependencyDiscovery dependencyAnalysisMode) { return(source.Aggregate(seed, func, dependencyAnalysisMode).Project(resultSelector, dependencyAnalysisMode)); }
/// <summary> /// Applies an accumulator function over a sequence. /// </summary> /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam> /// <param name="source">An <see cref="IBindableCollection{TSource}"/> to aggregate over.</param> /// <param name="func">An accumulator function to be invoked on each element.</param> /// <returns>The final accumulator value.</returns> public static IBindable <TSource> Aggregate <TSource>(this IBindableCollection <TSource> source, Expression <Func <IBindableCollection <TSource>, TSource> > func) { return(source.Aggregate(func, DefaultDependencyAnalysis)); }