public static IPInvokeObservable <T> TakeWhile <T>(this IPInvokeObservable <T> @this, Func <T, int, bool> func) { bool flag = true; int i = 0; return(@this.Observe(new PInvokeQuery <T, T>((s, v) => (flag &= func(v, i++)) && s.OnNext(v)))); }
public static IPInvokeQueryEndNode <TResult> Aggregate <T, TAccumulate, TResult>(this IPInvokeObservable <T> @this, TAccumulate seed, Func <TAccumulate, T, TAccumulate> func, Func <TAccumulate, TResult> resultSelector) { TAccumulate accumulate = seed; return(@this.Observe(new PInvokeQueryEndpoint <T, TResult>( v => accumulate = func(seed, v), () => resultSelector(accumulate)))); }
public static IPInvokeQueryEndNode <int> Count <T>(this IPInvokeObservable <T> @this) { int count = 0; return(@this.Observe(new PInvokeQueryEndpoint <T, int>( v => count++, () => count))); }
public static IPInvokeQueryEndNode <T> LastOrDefault <T>(this IPInvokeObservable <T> @this) { T value = default(T); return(@this.Observe(new PInvokeQueryEndpoint <T, T>( v => value = v, () => value))); }
public static IPInvokeQueryEndNode <bool> Any <T>(this IPInvokeObservable <T> @this, Func <T, bool> func) { bool flag = false; return(@this.Observe(new PInvokeQueryEndpoint <T, bool>( v => (flag |= func(v)), () => flag))); }
public static IPInvokeObservable <T2> SelectMany <T1, T2>(this IPInvokeObservable <T1> @this, Func <T1, IEnumerable <T2> > func) => @this.Observe(new PInvokeQuery <T1, T2>((s, v) => { foreach (var item in func(v)) { if (!s.OnNext(item)) { return(false); } } return(true); }));
public static IPInvokeQueryEndNode <bool> Any <T>(this IPInvokeObservable <T> @this) { bool flag = false; return(@this.Observe(new PInvokeQueryEndpoint <T, bool>( v => { flag = true; return false; }, () => flag))); }
public static IPInvokeQueryEndNode <int> Count <T>(this IPInvokeObservable <T> @this, Func <T, bool> func) { int count = 0; return(@this.Observe(new PInvokeQueryEndpoint <T, int>( v => { if (func(v)) { count++; } }, () => count))); }
public static IPInvokeQueryEndNode <bool> All <T>(this IPInvokeObservable <T> @this, Func <T, bool> func) { bool?flag = null; return(@this.Observe(new PInvokeQueryEndpoint <T, bool>( v => { var f = flag ?? true; f &= func(v); flag = f; return flag.Value; }, () => flag ?? false))); }
public static IPInvokeObservable <T2> Select <T1, T2>(this IPInvokeObservable <T1> @this, Func <T1, int, T2> func) { int i = 0; return(@this.Observe(new PInvokeQuery <T1, T2>((s, v) => s.OnNext(func(v, i++))))); }
public static IPInvokeObservable <T2> Select <T1, T2>(this IPInvokeObservable <T1> @this, Func <T1, T2> func) => @this.Observe(new PInvokeQuery <T1, T2>((s, v) => s.OnNext(func(v))));
public static IPInvokeObservable <T> Where <T>(this IPInvokeObservable <T> @this, Func <T, int, bool> func) { int i = 0; return(@this.Observe(new PInvokeQuery <T, T>((s, v) => func(v, i++) || s.OnNext(v)))); }
public static IPInvokeQueryEndNode ForEach <T>(this IPInvokeObservable <T> @this, Action <T, int> action) { int i = 0; return(@this.Observe(new PInvokeQueryEndpoint <T>(v => action(v, i++)))); }
public static IPInvokeObservable <T> Distinct <T, TKey>(this IPInvokeObservable <T> @this, Func <T, TKey> func, IEqualityComparer <TKey> comparer) { var hashSet = new HashSet <TKey>(comparer); return(@this.Observe(new PInvokeQuery <T, T>((s, v) => hashSet.Add(func(v)) ? s.OnNext(v) : true))); }
public static IPInvokeObservable <T> Where <T>(this IPInvokeObservable <T> @this, Func <T, bool> func) => @this.Observe(new PInvokeQuery <T, T>((s, v) => func(v) || s.OnNext(v)));
public static IPInvokeQueryEndNode ForEach <T>(this IPInvokeObservable <T> @this, Action <T> action) => @this.Observe(new PInvokeQueryEndpoint <T>(v => action(v)));
public static IPInvokeObservable <T> Skip <T>(this IPInvokeObservable <T> @this, int count) { int i = 0; return(@this.Observe(new PInvokeQuery <T, T>((s, v) => (i++ < count) || s.OnNext(v)))); }
public static IPInvokeObservable <T> SkipWhile <T>(this IPInvokeObservable <T> @this, Func <T, bool> func) { bool flag = true; return(@this.Observe(new PInvokeQuery <T, T>((s, v) => (flag &= func(v)) || s.OnNext(v)))); }