Class AnonymousObservable<T>
Class to create an IObservable<T> instance from a delegate-based implementation of the Subscribe method.
Implements
IObservable<T>
Inherited Members
Namespace: System.Reactive
Assembly: System.Reactive.Core.dll
Syntax
public sealed class AnonymousObservable<T> : ObservableBase<T>, IObservable<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the sequence. |
Constructors
| Improve this Doc View SourceAnonymousObservable(Func<IObserver<T>, IDisposable>)
Creates an observable sequence object from the specified subscription function.
Declaration
public AnonymousObservable(Func<IObserver<T>, IDisposable> subscribe)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IObserver<T>, IDisposable> | subscribe | Subscribe method implementation. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
Methods
| Improve this Doc View SourceSubscribeCore(IObserver<T>)
Calls the subscription function that was supplied to the constructor.
Declaration
protected override 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. |
Overrides
System.Reactive.ObservableBase<T>.SubscribeCore(System.IObserver<T>)