Show / Hide Table of Contents

    Class Observer<T>

    Observer class.

    Inheritance
    Object
    Disposable
    Observer<T>
    Implements
    IDisposable
    IObserver<T>
    Inherited Members
    Disposable.Dispose()
    Disposable.IsDisposed
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.Graph.Communications.Common
    Assembly: Microsoft.Graph.Communications.Common.dll
    Syntax
    public sealed class Observer<T> : Disposable, IDisposable, IObserver<T>
    Type Parameters
    Name Description
    T

    Type of the value the observer returns.

    Constructors

    Observer(IObservable<T>, Action<T>, Action<Exception>, Action)

    Initializes a new instance of the Observer<T> class.

    Declaration
    public Observer(IObservable<T> observable, Action<T> onNext, Action<Exception> onError = null, Action onCompleted = null)
    Parameters
    Type Name Description
    IObservable<T> observable

    Observable object.

    Action<T> onNext

    Callback for next.

    Action<Exception> onError

    Callback for error.

    Action onCompleted

    Callback for completed.

    Methods

    Dispose(Boolean)

    Protected implementation of dispose. This will be triggered only once regardless if manually disposed or garbage collected.

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

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    Overrides
    Disposable.Dispose(Boolean)

    Explicit Interface Implementations

    IObserver<T>.OnCompleted()

    Callback when observer has no more data.

    Declaration
    void IObserver<T>.OnCompleted()

    IObserver<T>.OnError(Exception)

    Callback when observer hits an error.

    Declaration
    void IObserver<T>.OnError(Exception error)
    Parameters
    Type Name Description
    Exception error

    Exception info.

    IObserver<T>.OnNext(T)

    Callback when data arrives.

    Declaration
    void IObserver<T>.OnNext(T value)
    Parameters
    Type Name Description
    T value

    Observed value.

    Implements

    System.IDisposable
    System.IObserver<T>

    Extension Methods

    AdditionalDataExtensions.SetInAdditionalData(Object, String, Object)
    Extensions.Pin(Object)
    Extensions.ChangeType(Object, Type)
    Extensions.ChangeType<T>(Object)
    Extensions.TryDispose(Object, IGraphLogger)
    ReflectionUtils.GetPropertyUsingReflection(Object, String)
    ReflectionUtils.SetPropertyUsingReflection(Object, String, Object)
    Validator.IsNull(Object, String, String)
    Validator.NotNull<T>(T, String, String)
    Validator.Equals<T>(T, T, String, String)
    Validator.Equals<T, TE>(T, T, String)
    Validator.NotEquals<T>(T, T, String, String)
    Back to top Copyright (c) Microsoft Corporation. All rights reserved.