Class NodeScript
Represents a node script
public abstract class NodeScript : CorePropertyChanged, INodeScript, IDisposable, IStorageModel, IPluginFeatureDependent
- Inheritance
-
objectCorePropertyChangedNodeScript
- Implements
- Derived
- Extension Methods
Constructors
NodeScript(string, string, object?, List<DefaultNode>?)
Creates a new instance of the NodeScript class with a name, description and optional context
protected NodeScript(string name, string description, object? context = null, List<DefaultNode>? defaultNodes = null)
Parameters
namestringThe name of the node script
descriptionstringThe description of the node script
contextobjectThe context of the node script, usually a Profile or ProfileConfiguration
defaultNodesList<DefaultNode>A list of default nodes to add to the node script.
Properties
Context
Gets or sets the context of the node script, usually a Profile or ProfileConfiguration.
public object? Context { get; set; }
Property Value
- object
Description
Gets the description of the node script.
public string Description { get; }
Property Value
Entity
Gets the entity used to store this script.
public NodeScriptEntity Entity { get; }
Property Value
- NodeScriptEntity
ExitNode
Gets or sets the exit node of the script
protected INode ExitNode { get; set; }
Property Value
ExitNodeConnected
Gets a boolean indicating whether the exit node is connected to any other nodes
public abstract bool ExitNodeConnected { get; }
Property Value
Name
Gets the name of the node script.
public string Name { get; }
Property Value
Nodes
Gets an enumerable of all the nodes on this script.
public IEnumerable<INode> Nodes { get; }
Property Value
ResultType
Gets the return type of the node script.
public abstract Type ResultType { get; }
Property Value
Methods
AddNode(INode)
Adds a node to the script
public void AddNode(INode node)
Parameters
nodeINodeThe node to add
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetFeatureDependencies()
Gets the plugin features this class depends on, may contain the same plugin feature twice if depending on it in multiple ways.
public IEnumerable<PluginFeature> GetFeatureDependencies()
Returns
- IEnumerable<PluginFeature>
A List<T> of PluginFeature this class depends on.
Load()
Loads the model from its associated entity
public void Load()
LoadConnections()
Loads missing connections between the nodes of this node script from storage
public void LoadConnections()
RemoveNode(INode)
Removes a node from the script
Note: If the node is IDisposable you must dispose it yourself, unless you plan to reuse the node.
public void RemoveNode(INode node)
Parameters
nodeINodeThe node to remove
Run()
Runs the script, evaluating nodes where needed
public void Run()
Save()
Saves the model to its associated entity
public void Save()
Events
NodeAdded
Occurs whenever a node was added to the script
public event EventHandler<SingleValueEventArgs<INode>>? NodeAdded
Event Type
NodeRemoved
Occurs whenever a node was removed from the script
public event EventHandler<SingleValueEventArgs<INode>>? NodeRemoved