Table of Contents

Class VariableNode

Namespace
LfrlAnvil.Reactive.State.Internal
Assembly
LfrlAnvil.Reactive.State.dll

Represents a type-erased variable state node.

public abstract class VariableNode : IVariableNode
Inheritance
VariableNode
Implements
Derived
Inherited Members
Extension Methods

Constructors

VariableNode()

Creates a new VariableNode instance.

protected VariableNode()

Properties

OnChange

Event stream that emits events when variable's value changes.

public abstract IEventStream<IVariableNodeEvent> OnChange { get; }

Property Value

IEventStream<IVariableNodeEvent>

OnValidate

Event stream that emits events when variable's validation state changes.

public abstract IEventStream<IVariableNodeEvent> OnValidate { get; }

Property Value

IEventStream<IVariableNodeEvent>

Parent

Parent node.

public IVariableNode? Parent { get; }

Property Value

IVariableNode

State

Specifies this node's current state.

public abstract VariableState State { get; }

Property Value

VariableState

Methods

CreateState(VariableState, VariableState, bool)

Calculates new VariableState.

[Pure]
protected static VariableState CreateState(VariableState current, VariableState value, bool enabled)

Parameters

current VariableState

Current state.

value VariableState

State to set.

enabled bool

Specifies whether the value should be included (when set to true) or excluded from the result.

Returns

VariableState

Calculated VariableState.

GetChildren()

Returns the collection of all children nodes.

[Pure]
public abstract IEnumerable<IVariableNode> GetChildren()

Returns

IEnumerable<IVariableNode>

New IEnumerable<T> instance.

SetAsParentOf(VariableNode)

Sets this variable as Parent of the other variable.

protected void SetAsParentOf(VariableNode other)

Parameters

other VariableNode

Child variable.

Exceptions

ArgumentException

When child variable's already has a different parent or child variable and this variable are the same.