/// <summary> /// Marks the observable as successfully completed. /// </summary> /// <param name="result">The result to use to complete the observable sequence.</param> /// <exception cref="InvalidOperationException">The observable has already completed.</exception> public void SetResult(T result) { if (_inner == null) { _inner = new TaskObservable(result); } else { _inner.SetResult(result); } }
/// <summary> /// Marks the observable as failed and binds the specified exception to the observable sequence. /// </summary> /// <param name="exception">The exception to bind to the observable sequence.</param> /// <exception cref="ArgumentNullException"><paramref name="exception"/> is <c>null</c>.</exception> /// <exception cref="InvalidOperationException">The observable has already completed.</exception> public void SetException(Exception exception) { if (exception == null) { throw new ArgumentNullException(nameof(exception)); } if (_inner == null) { _inner = new TaskObservable(exception); } else { _inner.SetException(exception); } }
public ObserverItem(IObserver <T> observer, TaskObservable <T> owner) { Observer = observer; Owner = owner; }