Beispiel #1
0
            public FilteringAsyncStream_UsingEvents(IAsyncStream_UsingEvents <T> source, Func <T, bool> predicate)
            {
                _source    = source;
                _predicate = predicate;

                _source.DataAvailable += item => { if (_predicate(item))
                                                   {
                                                       DataAvailable(item);
                                                   }
                };
            }
Beispiel #2
0
 public static IAsyncStream_UsingEvents <T> Where <T>(this IAsyncStream_UsingEvents <T> source, Func <T, bool> predicate)
 {
     return(new FilteringAsyncStream_UsingEvents <T>(source, predicate));
 }