Class NotifyReversableValue<T>
- Namespace
- NMF.Expressions
- Assembly
- NMF.Expressions.dll
base implementation of a reversable notify value
public class NotifyReversableValue<T> : INotifyReversableValue<T>, INotifyValue<T>, INotifiable, IDisposable, INotifyPropertyChanged, ISuccessorList
Type Parameters
T
The element type
- Inheritance
-
NotifyReversableValue<T>
- Implements
-
INotifyValue<T>
- Inherited Members
- Extension Methods
Constructors
NotifyReversableValue(Expression<Func<T>>, IDictionary<string, object>)
Create a new instance
public NotifyReversableValue(Expression<Func<T>> expression, IDictionary<string, object> parameterMappings = null)
Parameters
expression
Expression<Func<T>>The underlying expression
parameterMappings
IDictionary<string, object>Parameter mappings
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 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
IsReversable
Checks whether it is allowed to set values
public bool IsReversable { get; }
Property Value
Successors
The nodes that will get notified by this node.
public ISuccessorList Successors { get; }
Property Value
Value
Gets or sets the current value
public T Value { get; set; }
Property Value
- T
Methods
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 virtual 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.
OnAttach()
Occurs when this node gets (re)attached to another node for the first time
protected virtual void OnAttach()
OnDetach()
Occurs when the last successor of this node gets removed
protected virtual void OnDetach()
OnPropertyChanged(string)
Raises PropertyChanged
protected virtual void OnPropertyChanged(string propertyName)
Parameters
propertyName
stringthe name of the property
OnValueChanged(T, T)
Gets called when the value changed
protected virtual 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
PropertyChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler PropertyChanged
Event Type
ValueChanged
Gets fired when the value changed
public event EventHandler<ValueChangedEventArgs> ValueChanged