Class ObservableBase<T>
Abstract base class for implementations of the IObservable<T> interface.
Implements
Inherited Members
Namespace: System.Reactive
Assembly: System.Reactive.Core.dll
Syntax
public abstract class ObservableBase<T> : IObservable<T>
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the sequence. |
Remarks
If you don't need a named type to create an observable sequence (i.e. you rather need an instance rather than a reusable type), use the Observable.Create method to create an observable sequence with specified subscription behavior.
Methods
| Improve this Doc View SourceSubscribe(IObserver<T>)
Subscribes the given observer to the observable sequence.
Declaration
public IDisposable Subscribe(IObserver<T> observer)
Parameters
Type | Name | Description |
---|---|---|
IObserver<T> | observer | Observer that will receive notifications from the observable sequence. |
Returns
Type | Description |
---|---|
IDisposable | Disposable object representing an observer's subscription to the observable sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SubscribeCore(IObserver<T>)
Implement this method with the core subscription logic for the observable sequence.
Declaration
protected abstract IDisposable SubscribeCore(IObserver<T> observer)
Parameters
Type | Name | Description |
---|---|---|
IObserver<T> | observer | Observer to send notifications to. |
Returns
Type | Description |
---|---|
IDisposable | Disposable object representing an observer's subscription to the observable sequence. |