/// <summary> /// Filters a data-producer based on a predicate on each value /// </summary> /// <param name="source">The data-producer to be filtered</param> /// <param name="predicate">The condition to be satisfied</param> /// <returns>A filtered data-producer; only matching values will raise the DataProduced event</returns> public static IDataProducer <TSource> Where <TSource>(this IDataProducer <TSource> source, Func <TSource, bool> predicate) { predicate.ThrowIfNull("predicate"); return(source.Where((x, index) => predicate(x))); }