Class NotifyValue<T>
- Namespace
- NMF.Expressions
- Assembly
- NMF.Expressions.dll
Abstract base implementation of notify value
public abstract class NotifyValue<T> : INotifyValue<T>, INotifiable, IDisposable, ISuccessorList
Type Parameters
T
The element type
- Inheritance
-
NotifyValue<T>
- Implements
-
INotifyValue<T>
- Derived
- Inherited Members
- Extension Methods
Properties
AllSuccessors
public IEnumerable<INotifiable> AllSuccessors { get; }
Property Value
Count
The number of elements
public int Count { get; }
Property Value
Dependencies
Nodes that notify this node.
public abstract IEnumerable<INotifiable> Dependencies { get; }
Property Value
ExecutionMetaData
Used by the execution engine during incremental execution.
public ExecutionMetaData ExecutionMetaData { get; }
Property Value
HasSuccessors
True, if there is any successor, otherwise False
public bool HasSuccessors { get; }
Property Value
IsAttached
True, if successors are attached, otherwise False
public bool IsAttached { get; }
Property Value
Successors
The nodes that will get notified by this node.
public ISuccessorList Successors { get; }
Property Value
Value
Gets the current value
public abstract T Value { get; }
Property Value
- T
Methods
Attach()
protected virtual void Attach()
Detach()
protected virtual void Detach()
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetSuccessor(int)
Gets the successor at the given index
public INotifiable GetSuccessor(int index)
Parameters
index
intThe index
Returns
- INotifiable
The DDG node with the given index
Notify(IList<INotificationResult>)
Gets called when one of the dependencies signals a notification.
public abstract INotificationResult Notify(IList<INotificationResult> sources)
Parameters
sources
IList<INotificationResult>Contains information about what triggered this notification.
Returns
- INotificationResult
An object describing the changes that happened in this notification.
OnValueChanged(ValueChangedEventArgs)
Gets called when the value changed
protected virtual void OnValueChanged(ValueChangedEventArgs e)
Parameters
e
ValueChangedEventArgsevent args
OnValueChanged(T, T)
Raises the ValueChanged event
protected void OnValueChanged(T oldValue, T newValue)
Parameters
oldValue
Told value
newValue
Tnew value
Set(INotifiable)
Add the given DDG node to the list
public void Set(INotifiable node)
Parameters
node
INotifiableThe DDG node to add
SetDummy()
Sets a dummy
public void SetDummy()
Unset(INotifiable, bool)
Unset the given DDG node as successor
public void Unset(INotifiable node, bool leaveDummy = false)
Parameters
node
INotifiablethe DDG node
leaveDummy
boolTrue, to leave the dummy in operation, otherwise False
UnsetAll()
Clear the list
public void UnsetAll()
Events
ValueChanged
Gets fired when the value changed
public event EventHandler<ValueChangedEventArgs> ValueChanged