Class RxObserver<T>
An RxObserver class that observes an System.Reactive observable and subsequently triggers an IObservableValue<T> instance.
Inheritance
Namespace: Cortex.Net.Rx
Assembly: Cortex.Net.dll
Syntax
public sealed class RxObserver<T> : IObserver<T>, IDisposable, IObservableValue<T>, IValue<T>, IValue
Type Parameters
| Name | Description |
|---|---|
| T | The type of the observable. |
Properties
| Improve this Doc View SourceValue
Gets or sets the underlying value.
Declaration
public T Value { get; set; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
| Improve this Doc View SourceDispose()
Cleans up the subscription when the observer is disposed.
Declaration
public void Dispose()
Observe(EventHandler<ValueChangedEventArgs<T>>, Boolean)
Registers the secified event handler, and optionally fires it first.
Declaration
public void Observe(EventHandler<ValueChangedEventArgs<T>> changedEventHandler, bool fireImmediately)
Parameters
| Type | Name | Description |
|---|---|---|
| EventHandler<ValueChangedEventArgs<T>> | changedEventHandler | The event handler to register. |
| System.Boolean | fireImmediately | Whether to fire the event handler immediately. |
OnCompleted()
Notifies the observer that the provider has finished sending push-based notifications.
Declaration
public void OnCompleted()
OnError(Exception)
Notifies the observer that the provider has experienced an error condition.
Declaration
public void OnError(Exception error)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | error | An object that provides additional information about the error. |
OnNext(T)
Provides the observer with new data.
Declaration
public void OnNext(T value)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The current notification information. |
Events
| Improve this Doc View SourceChange
Event that fires before the value will change.
Declaration
public event EventHandler<ValueChangeEventArgs<T>> Change
Event Type
| Type | Description |
|---|---|
| EventHandler<ValueChangeEventArgs<T>> |
Changed
Event that fires after the value has changed.
Declaration
public event EventHandler<ValueChangedEventArgs<T>> Changed
Event Type
| Type | Description |
|---|---|
| EventHandler<ValueChangedEventArgs<T>> |
Explicit Interface Implementations
| Improve this Doc View SourceIValue.Value
Gets or sets the underlying value.
Declaration
object IValue.Value { get; set; }
Returns
| Type | Description |
|---|---|
| System.Object |