コード例 #1
0
        public static IDisposable Subscribe <TSource, TProperty>(this IObservable <TSource> source, IObservableGetProperty <TProperty> property)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            return(source.Subscribe(Observer2.Create <TSource>(o => property.OnNext())));
        }
コード例 #2
0
        public static IObservable <TSource> Do <TSource, TProperty>(this IObservable <TSource> source, IObservableGetProperty <TProperty> property)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            return(source.ChainNext <TSource, TSource>(obs => o =>
            {
                property.OnNext();
                obs.OnNext(o);
            }));
        }