// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. namespace System.Reactive { class BinaryObserver : IObserver, Notification>> { public BinaryObserver(IObserver leftObserver, IObserver rightObserver) { LeftObserver = leftObserver; RightObserver = rightObserver; } public BinaryObserver(Action> left, Action> right) : this(left.ToObserver(), right.ToObserver()) { } public IObserver LeftObserver { get; private set; } public IObserver RightObserver { get; private set; } void IObserver, Notification>>.OnNext(Either, Notification> value) { value.Switch(left => left.Accept(LeftObserver), right => right.Accept(RightObserver)); } void IObserver, Notification>>.OnError(Exception exception) { } void IObserver, Notification>>.OnCompleted() { } } }