Table of Contents

Method ConvertItems

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

ConvertItems<TSource, TDest>(Func<TSource, TDest?>, Func<IEnumerable<TDest>, bool>, IEnumerable<TSource>, int)

Converts items from the IEnumerable<T> specified in the source parameter to the destination by calling addToDest function. Item type is converted using convertItem function.

public static void ConvertItems<TSource, TDest>(Func<TSource, TDest?> convertItem, Func<IEnumerable<TDest>, bool> addToDest, IEnumerable<TSource> source, int bufferSize = 10)

Parameters

convertItem Func<TSource, TDest>

The function which converts item from the TSource type to the TDest type. Return Null to ignore the item.

addToDest Func<IEnumerable<TDest>, bool>

The function which is used to add items to the destination.

source IEnumerable<TSource>

Source of the items for the conversion.

bufferSize int

Size of the buffer for the items. Optional. Default is 10.

Type Parameters

TSource

Type of the item in the source.

TDest

Type of the destination item.