Table of Contents

Class NodeScript

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Represents a node script

public abstract class NodeScript : CorePropertyChanged, INodeScript, IDisposable, IStorageModel, IPluginFeatureDependent
Inheritance
object
CorePropertyChanged
NodeScript
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

name string

The name of the node script

description string

The description of the node script

context object

The context of the node script, usually a Profile or ProfileConfiguration

defaultNodes List<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

string

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

INode

ExitNodeConnected

Gets a boolean indicating whether the exit node is connected to any other nodes

public abstract bool ExitNodeConnected { get; }

Property Value

bool

Name

Gets the name of the node script.

public string Name { get; }

Property Value

string

Nodes

Gets an enumerable of all the nodes on this script.

public IEnumerable<INode> Nodes { get; }

Property Value

IEnumerable<INode>

ResultType

Gets the return type of the node script.

public abstract Type ResultType { get; }

Property Value

Type

Methods

AddNode(INode)

Adds a node to the script

public void AddNode(INode node)

Parameters

node INode

The 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

node INode

The 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

EventHandler<SingleValueEventArgs<INode>>

NodeRemoved

Occurs whenever a node was removed from the script

public event EventHandler<SingleValueEventArgs<INode>>? NodeRemoved

Event Type

EventHandler<SingleValueEventArgs<INode>>