<PackageReference Include="System.Reactive" Version="4.1.2" />

Plan<T1, T2, T3, TResult>

class Plan<T1, T2, T3, TResult> : Plan<TResult>
using System.Collections.Generic; namespace System.Reactive.Joins { internal class Plan<T1, T2, T3, TResult> : Plan<TResult> { internal Pattern<T1, T2, T3> Expression { get; } internal Func<T1, T2, T3, TResult> Selector { get; } internal Plan(Pattern<T1, T2, T3> expression, Func<T1, T2, T3, TResult> selector) { Expression = expression; Selector = selector; } internal override ActivePlan Activate(Dictionary<object, IJoinObserver> externalSubscriptions, IObserver<TResult> observer, Action<ActivePlan> deactivate) { IObserver<TResult> observer2 = observer; Action<Exception> onError = observer2.OnError; JoinObserver<T1> firstJoinObserver = Plan<TResult>.CreateObserver(externalSubscriptions, Expression.First, onError); JoinObserver<T2> secondJoinObserver = Plan<TResult>.CreateObserver(externalSubscriptions, Expression.Second, onError); JoinObserver<T3> thirdJoinObserver = Plan<TResult>.CreateObserver(externalSubscriptions, Expression.Third, onError); ActivePlan<T1, T2, T3> activePlan = null; activePlan = new ActivePlan<T1, T2, T3>(firstJoinObserver, secondJoinObserver, thirdJoinObserver, delegate(T1 first, T2 second, T3 third) { TResult val = default(TResult); try { val = Selector(first, second, third); } catch (Exception error) { observer.OnError(error); return; } observer.OnNext(val); }, delegate { firstJoinObserver.RemoveActivePlan(activePlan); secondJoinObserver.RemoveActivePlan(activePlan); thirdJoinObserver.RemoveActivePlan(activePlan); deactivate(activePlan); }); firstJoinObserver.AddActivePlan(activePlan); secondJoinObserver.AddActivePlan(activePlan); thirdJoinObserver.AddActivePlan(activePlan); return activePlan; } } }