Debian Codegraph @

external/rx/Rx/NET/Source/Tests.System.Reactive/NullErrorObservable.cs

raw
1 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
3 using System.Reactive.Disposables;
4 using System;
5
6 namespace ReactiveTests
7 {
8 public class NullErrorObservable<T> : IObservable<T>
9 {
10 public static NullErrorObservable<T> Instance = new NullErrorObservable<T>();
11
12 private NullErrorObservable()
13 {
14 }
15
16 public IDisposable Subscribe(IObserver<T> observer)
17 {
18 if (observer == null)
19 throw new ArgumentNullException("observer");
20
21 observer.OnError(null);
22 return Disposable.Empty;
23 }
24 }
25 }