|
3 | 3 | using System.ComponentModel;
|
4 | 4 | using System.Reactive.Concurrency;
|
5 | 5 | using System.Reactive.Disposables;
|
| 6 | +using System.Reactive.PlatformServices; |
| 7 | +using System.Runtime.ExceptionServices; |
6 | 8 | using Reactive.Bindings.Internals;
|
7 | 9 |
|
8 | 10 | namespace Reactive.Bindings
|
@@ -31,6 +33,7 @@ public class ReadOnlyReactiveProperty<T> : IReadOnlyReactiveProperty<T>, IObserv
|
31 | 33 |
|
32 | 34 | private bool IsRaiseLatestValueOnSubscribe => (_mode & ReactivePropertyMode.RaiseLatestValueOnSubscribe) == ReactivePropertyMode.RaiseLatestValueOnSubscribe;
|
33 | 35 | private bool IsDistinctUntilChanged => (_mode & ReactivePropertyMode.DistinctUntilChanged) == ReactivePropertyMode.DistinctUntilChanged;
|
| 36 | + private bool IsIgnoreException => (_mode & ReactivePropertyMode.IgnoreException) == ReactivePropertyMode.IgnoreException; |
34 | 37 |
|
35 | 38 | /// <summary>
|
36 | 39 | /// Initializes a new instance of the <see cref="ReadOnlyReactiveProperty{T}"/> class.
|
@@ -66,6 +69,10 @@ public ReadOnlyReactiveProperty(
|
66 | 69 |
|
67 | 70 | object IReadOnlyReactiveProperty.Value => Value;
|
68 | 71 |
|
| 72 | + /// <summary> |
| 73 | + /// Gets a value indicating whether this instance is disposed. |
| 74 | + /// </summary> |
| 75 | + /// <value><c>true</c> if this instance is disposed; otherwise, <c>false</c>.</value> |
69 | 76 | public bool IsDisposed => (int)_mode == IsDisposedFlagNumber;
|
70 | 77 |
|
71 | 78 | /// <summary>
|
@@ -181,7 +188,8 @@ void IObserver<T>.OnNext(T value)
|
181 | 188 |
|
182 | 189 | void IObserver<T>.OnError(Exception error)
|
183 | 190 | {
|
184 |
| - // do nothing. |
| 191 | + if (IsIgnoreException) return; |
| 192 | + ExceptionDispatchInfo.Capture(error).Throw(); |
185 | 193 | }
|
186 | 194 |
|
187 | 195 | void IObserver<T>.OnCompleted()
|
|
0 commit comments