Search Results for

    Show / Hide Table of Contents

    Class ObserverBase<T>

    Abstract base class for implementations of the IObserver<T> interface.

    Inheritance
    Object
    ObserverBase<T>
    AnonymousObserver<T>
    Implements
    IObserver<T>
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ToString()
    Object.ReferenceEquals(Object, Object)
    Namespace: System.Reactive
    Assembly: System.Reactive.Core.dll
    Syntax
    public abstract class ObserverBase<T> : IObserver<T>, IDisposable
    Type Parameters
    Name Description
    T

    The type of the elements in the sequence.

    Remarks

    This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.

    Constructors

    | Improve this Doc View Source

    ObserverBase()

    Creates a new observer in a non-stopped state.

    Declaration
    protected ObserverBase()

    Methods

    | Improve this Doc View Source

    Dispose()

    Disposes the observer, causing it to transition to the stopped state.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Core implementation of IDisposable.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    true if the Dispose call was triggered by the IDisposable.Dispose method; false if it was triggered by the finalizer.

    | Improve this Doc View Source

    OnCompleted()

    Notifies the observer of the end of the sequence.

    Declaration
    public void OnCompleted()
    | Improve this Doc View Source

    OnCompletedCore()

    Implement this method to react to the end of the sequence.

    Declaration
    protected abstract void OnCompletedCore()
    Remarks

    This method only gets called when the observer hasn't stopped yet, and causes the observer to stop.

    | Improve this Doc View Source

    OnError(Exception)

    Notifies the observer that an exception has occurred.

    Declaration
    public void OnError(Exception error)
    Parameters
    Type Name Description
    Exception error

    The error that has occurred.

    Exceptions
    Type Condition
    ArgumentNullException

    error is null.

    | Improve this Doc View Source

    OnErrorCore(Exception)

    Implement this method to react to the occurrence of an exception.

    Declaration
    protected abstract void OnErrorCore(Exception error)
    Parameters
    Type Name Description
    Exception error

    The error that has occurred.

    Remarks

    This method only gets called when the observer hasn't stopped yet, and causes the observer to stop.

    | Improve this Doc View Source

    OnNext(T)

    Notifies the observer of a new element in the sequence.

    Declaration
    public void OnNext(T value)
    Parameters
    Type Name Description
    T value

    Next element in the sequence.

    | Improve this Doc View Source

    OnNextCore(T)

    Implement this method to react to the receival of a new element in the sequence.

    Declaration
    protected abstract void OnNextCore(T value)
    Parameters
    Type Name Description
    T value

    Next element in the sequence.

    Remarks

    This method only gets called when the observer hasn't stopped yet.

    Implements

    System.IObserver<T>
    System.IDisposable

    Extension Methods

    Observer.ToNotifier<T>(IObserver<T>)
    Observer.AsObserver<T>(IObserver<T>)
    Observer.Checked<T>(IObserver<T>)
    Observer.NotifyOn<T>(IObserver<T>, IScheduler)
    Observer.NotifyOn<T>(IObserver<T>, SynchronizationContext)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX