| 1 |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. |
| 2 |
|
| 3 |
using System; |
| 4 |
using System.Reactive.Linq; |
| 5 |
using System.Reactive.Subjects; |
| 6 |
|
| 7 |
namespace ReactiveTests.Tests |
| 8 |
{ |
| 9 |
class ConnectableObservable<T> : IConnectableObservable<T> |
| 10 |
{ |
| 11 |
private IConnectableObservable<T> _o; |
| 12 |
|
| 13 |
public ConnectableObservable(IObservable<T> o, ISubject<T, T> s) |
| 14 |
{ |
| 15 |
_o = o.Multicast(s); |
| 16 |
} |
| 17 |
|
| 18 |
public IDisposable Connect() |
| 19 |
{ |
| 20 |
return _o.Connect(); |
| 21 |
} |
| 22 |
|
| 23 |
public IDisposable Subscribe(IObserver<T> observer) |
| 24 |
{ |
| 25 |
return _o.Subscribe(observer); |
| 26 |
} |
| 27 |
} |
| 28 |
} |