Show / Hide Table of Contents

Class ComputedValue<T>

A node in the state dependency root that observes other nodes, and can be observed itself.

Inheritance
System.Object
ComputedValue<T>
Implements
IObservable
IDerivation
IDependencyNode
IComputedValue<T>
IComputedValue
IValue<T>
IValue
Namespace: Cortex.Net.Core
Assembly: Cortex.Net.dll
Syntax
public class ComputedValue<T> : object, IObservable, IDerivation, IDependencyNode, IComputedValue<T>, IComputedValue, IValue<T>, IValue
Type Parameters
Name Description
T

The type of the computed value.

Properties

| Improve this Doc View Source

DependenciesState

Gets or sets the state of the dependencies of this IDerivation instance.

Declaration
public DerivationState DependenciesState { get; set; }
Property Value
Type Description
DerivationState
| Improve this Doc View Source

IsBeingObserved

Gets or sets a value indicating whether the observable is being observed. An observable is being observed when at least one derivation actually accesses its value.

Declaration
public bool IsBeingObserved { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsPendingUnobservation

Gets or sets a value indicating whether this atom is pending Unobservation.

Declaration
public bool IsPendingUnobservation { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsTracing

Gets or sets the trace mode of this Derivation.

Declaration
public TraceMode IsTracing { get; set; }
Property Value
Type Description
TraceMode
| Improve this Doc View Source

LastAccessedBy

Gets or sets the Id of the derivation run that last accessed this observable. If this Id equals the RunId of the current derivation the dependency is already established.

Declaration
public int LastAccessedBy { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

LowestObserverState

Gets or sets the lowest DerivationState on any of it's observers.

Declaration
public DerivationState LowestObserverState { get; set; }
Property Value
Type Description
DerivationState
| Improve this Doc View Source

Name

Gets the Name of the Atom instance.

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

NewObserving

Gets a set of IObservable instances that have been hit during a new derivation run.

Declaration
public ISet<IObservable> NewObserving { get; }
Property Value
Type Description
ISet<IObservable>
| Improve this Doc View Source

Observers

Gets the Observers.

Declaration
public ISet<IDerivation> Observers { get; }
Property Value
Type Description
ISet<IDerivation>
| Improve this Doc View Source

Observing

Gets a set of IObservable instances that are currently observed.

Declaration
public ISet<IObservable> Observing { get; }
Property Value
Type Description
ISet<IObservable>
| Improve this Doc View Source

RequiresObservable

Gets a value indicating whether to warn if this derivation is required to visit at least one observable.

Declaration
public bool RequiresObservable { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

RunId

Gets or sets the id of the current run of a derivation. Each time the derivation is tracked this number is increased by one. This number is unique within the current shared state.

Declaration
public int RunId { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

SharedState

Gets the Shared State of all the nodes in the dependency graph.

Declaration
public ISharedState SharedState { get; }
Property Value
Type Description
ISharedState
| Improve this Doc View Source

Value

Gets or sets the underlying value.

Declaration
public T Value { get; set; }
Property Value
Type Description
T

Methods

| Improve this Doc View Source

Observe(EventHandler<ValueChangedEventArgs<T>>, Boolean)

Registers the secified event handler, and optionally fires it first.

Declaration
public IDisposable 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.

Returns
Type Description
IDisposable

A disposable to remove the event handler when the disposable is disposed.

| Improve this Doc View Source

OnBecomeObserved()

Method that triggers event BecomeObserved.

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

OnBecomeStale()

Propagates confirmation of a possible change to all observers of this ComputedValue<T> for delayed computation.

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

OnBecomeUnobserved()

Method that triggers event BecomeUnobserved.

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

Suspend()

Suspends computation of this computed value when the last observer leaves. Computed values are automatically teared down when the last observer leaves. This process happens recursively, this computed might be the last observabe of another, etc.

Declaration
public void Suspend()

Events

| Improve this Doc View Source

BecomeObserved

Event that will fire after the Atom has become observed.

Declaration
public event EventHandler BecomeObserved
Event Type
Type Description
EventHandler
| Improve this Doc View Source

BecomeUnobserved

Event that will fire after the observable has become unobserved.

Declaration
public event EventHandler BecomeUnobserved
Event Type
Type Description
EventHandler
| Improve this Doc View Source

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 Source

IValue.Value

Gets or sets the value. Explicit implementation of Value.

Declaration
object IValue.Value { get; set; }
Returns
Type Description
System.Object

Implements

IObservable
IDerivation
IDependencyNode
IComputedValue<T>
IComputedValue
IValue<T>
IValue

Extension Methods

TraceExtensions.Trace<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>, TraceMode)
ReactiveObjectTypeUtilExtensions.GetObservable(Object)
ReactiveObjectTypeUtilExtensions.GetObservable<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX