Class VariableNode
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
OnValidate
Event stream that emits events when variable's validation state changes.
public abstract IEventStream<IVariableNodeEvent> OnValidate { get; }
Property Value
Parent
Parent node.
public IVariableNode? Parent { get; }
Property Value
State
Specifies this node's current state.
public abstract VariableState State { get; }
Property Value
Methods
CreateState(VariableState, VariableState, bool)
Calculates new VariableState.
[Pure]
protected static VariableState CreateState(VariableState current, VariableState value, bool enabled)
Parameters
currentVariableStateCurrent state.
valueVariableStateState to set.
enabledboolSpecifies whether the
valueshould 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
otherVariableNodeChild variable.
Exceptions
- ArgumentException
When child variable's already has a different parent or child variable and this variable are the same.