Ejemplo n.º 1
0
        public static IRx <T> Computed <T, T1>(IRx <T1> source1, Func <T1, T> compute, IEqualityComparer <T> equalityComparer = null)
        {
            IRx <T> rx = new ComputedRx <T>(() => compute(source1.Value), equalityComparer);

            source1.Watch(rx.Update);

            return(rx);
        }
Ejemplo n.º 2
0
        public static IRx <T> Computed <T, T1, T2, T3, T4>(IRx <T1> source1, IRx <T2> source2, IRx <T3> source3, IRx <T4> source4, Func <T1, T2, T3, T4, T> compute, IEqualityComparer <T> equalityComparer = null)
        {
            IRx <T> rx = new ComputedRx <T>(() => compute(source1.Value, source2.Value, source3.Value, source4.Value), equalityComparer);

            source1.Watch(rx.Update);
            source2.Watch(rx.Update);
            source3.Watch(rx.Update);
            source4.Watch(rx.Update);

            return(rx);
        }
Ejemplo n.º 3
0
        public static IRx <T> Computed <T, T1, T2, T3, T4, T5, T6, T7, T8>(IRx <T1> source1, IRx <T2> source2, IRx <T3> source3, IRx <T4> source4, IRx <T5> source5, IRx <T6> source6, IRx <T7> source7, IRx <T8> source8, Func <T1, T2, T3, T4, T5, T6, T7, T8, T> compute, IEqualityComparer <T> equalityComparer = null)
        {
            IRx <T> rx = new ComputedRx <T>(() => compute(source1.Value, source2.Value, source3.Value, source4.Value, source5.Value, source6.Value, source7.Value, source8.Value), equalityComparer);

            source1.Watch(rx.Update);
            source2.Watch(rx.Update);
            source3.Watch(rx.Update);
            source4.Watch(rx.Update);
            source5.Watch(rx.Update);
            source6.Watch(rx.Update);
            source7.Watch(rx.Update);
            source8.Watch(rx.Update);

            return(rx);
        }
Ejemplo n.º 4
0
        public static IRx <T> Watch <T>(this IRx <T> rx, RxValueChanged <T> valueChanged)
        {
            rx.ValueChanged += valueChanged;

            return(rx);
        }
Ejemplo n.º 5
0
        public static IRx <T> Watch <T>(this IRx <T> rx, Action <IRx <T>, T> valueChanged)
        {
            rx.ValueChanged += (source, newValue, oldValue) => valueChanged(source, newValue);

            return(rx);
        }
Ejemplo n.º 6
0
        public static IRx <T> Watch <T>(this IRx <T> rx, Func <bool> valueChanged)
        {
            rx.ValueChanged += (source, newValue, oldValue) => valueChanged();

            return(rx);
        }