Show / Hide Table of Contents

Class ObservableExtensions

Extension methods for the IObservable interface.

Inheritance
System.Object
ObservableExtensions
Namespace: Cortex.Net.Core
Assembly: Cortex.Net.dll
Syntax
public static class ObservableExtensions : object

Methods

| Improve this Doc View Source

AddObserver(IObservable, IDerivation)

Adds an observer that implements IDerivation into the set of observers. for this IObservable instance.

Declaration
public static void AddObserver(this IObservable observable, IDerivation derivation)
Parameters
Type Name Description
IObservable observable

The observable to use.

IDerivation derivation

The observer to add.

| Improve this Doc View Source

HasObservers(IObservable)

Indicates whether the observable has Observers or not.

Declaration
public static bool HasObservers(this IObservable observable)
Parameters
Type Name Description
IObservable observable

The observable to check for observers.

Returns
Type Description
System.Boolean

A boolean indicating whether the observable has observers or not.

| Improve this Doc View Source

IsComputedValue(IObservable)

Checks whether the observable is a derivation as well.

Declaration
public static bool IsComputedValue(this IObservable observable)
Parameters
Type Name Description
IObservable observable

The observable to check.

Returns
Type Description
System.Boolean

True if the observable is a derivation, false otherwise.

| Improve this Doc View Source

IsDerivation(IObservable)

Checks whether the observable is a derivation as well.

Declaration
public static bool IsDerivation(this IObservable observable)
Parameters
Type Name Description
IObservable observable

The observable to check.

Returns
Type Description
System.Boolean

True if the observable is a derivation, false otherwise.

| Improve this Doc View Source

PropagateChangeConfirmed(IObservable)

Propagates confirmation of a change to all observers of this observable.

Declaration
public static void PropagateChangeConfirmed(this IObservable observable)
Parameters
Type Name Description
IObservable observable

The observable.

Remarks

Called by ComputedValue when it recalculate and its value changed.

| Improve this Doc View Source

PropagateChanged(IObservable)

Propagates a change to all observers of this observable.

Declaration
public static void PropagateChanged(this IObservable observable)
Parameters
Type Name Description
IObservable observable

The observable.

Remarks

Called by Atom when its value has changed.

| Improve this Doc View Source

PropagateMaybeChanged(IObservable)

Propagates confirmation of a possible change to all observers of this observable for delayed computation.

Declaration
public static void PropagateMaybeChanged(this IObservable observable)
Parameters
Type Name Description
IObservable observable

The observable.

Remarks

Called by ComputedValue when its dependency changed, but we don't wan't to immediately recompute.

| Improve this Doc View Source

RemoveObserver(IObservable, IDerivation)

Removes an Observer IDerivation from the set of observers.

Declaration
public static void RemoveObserver(this IObservable observable, IDerivation derivation)
Parameters
Type Name Description
IObservable observable

The observable to use.

IDerivation derivation

The observer to add.

| Improve this Doc View Source

ReportObserved(IObservable)

Report an observable as being observed to the current tracking derivation (observer).

Declaration
public static bool ReportObserved(this IObservable observable)
Parameters
Type Name Description
IObservable observable

The observable.

Returns
Type Description
System.Boolean

True when this observable is added to the "new observing" set of the derivation.

Remarks

This method will write to the debug log when state reads are currently not allowed.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX