Class Observable<T>
Observable Base class
Inherited Members
Namespace: Microsoft.Graph.Communications.Common
Assembly: Microsoft.Graph.Communications.Common.dll
Syntax
public class Observable<T> : ObjectRoot, IObservable<T>, IObserver<T>, INotifyCollectionChanged
Type Parameters
Name | Description |
---|---|
T | Type of the value being observed. |
Constructors
Observable(IGraphLogger)
Initializes a new instance of the Observable<T> class.
Declaration
public Observable(IGraphLogger logger)
Parameters
Type | Name | Description |
---|---|---|
IGraphLogger | logger | Logger instance. |
Properties
Observers
Gets the observers.
Declaration
public ICollection<IObserver<T>> Observers { get; }
Property Value
Type | Description |
---|---|
ICollection<IObserver<T>> |
Methods
OnCompleted()
Notify observers of completion.
Declaration
public void OnCompleted()
OnError(Exception)
Notify observers of error.
Declaration
public void OnError(Exception error)
Parameters
Type | Name | Description |
---|---|---|
Exception | error | Exception information. |
OnNext(T)
Notify observers.
Declaration
public void OnNext(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value to observers. |
OnNext(T, IEnumerable<IObserver<T>>)
Notify observers.
Declaration
public void OnNext(T value, IEnumerable<IObserver<T>> observersSubset)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value to observers. |
IEnumerable<IObserver<T>> | observersSubset | Subset of observers to notify. |
Subscribe(IObserver<T>)
Notifies the provider that an observer is to receive notifications.
Declaration
public virtual IDisposable Subscribe(IObserver<T> observer)
Parameters
Type | Name | Description |
---|---|---|
IObserver<T> | observer | The object that is to receive notifications. |
Returns
Type | Description |
---|---|
IDisposable | A reference to an interface that allows observers to stop receiving notifications before the provider has finished sending them. |
Events
CollectionChanged
Collection changed event.
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
Type | Description |
---|---|
NotifyCollectionChangedEventHandler |