1using System.Collections.Generic;
3using System.Threading.Tasks;
36 [Page(2,
"Script", 100)]
37 [Header(14,
"Command ID:")]
38 [ToolTip(15,
"ID of command, as referenced by the caller.")]
45 [Page(2,
"Script", 100)]
46 [Header(20,
"Command Name:")]
47 [ToolTip(21,
"Displayable name of command.")]
54 [Page(2,
"Script", 100)]
55 [Header(16,
"Sort Category:")]
56 [ToolTip(17,
"Category in which the command will be ordered.")]
63 [Page(2,
"Script", 100)]
64 [Header(18,
"Sort Key:")]
65 [ToolTip(19,
"Key used when ordering commands within a sort category.")]
72 [Page(2,
"Script", 100)]
73 [Header(22,
"Confirmation Message:")]
74 [ToolTip(23,
"Optional confirmation message. If defined, it will be presented to users before executing the command.")]
80 [Page(2,
"Script", 100)]
81 [Header(24,
"Success Message:")]
82 [ToolTip(25,
"Optional success message. If defined, it will be presented to users after the successful execution of the command.")]
88 [Page(2,
"Script", 100)]
89 [Header(26,
"Failure Message:")]
90 [ToolTip(27,
"Optional failure message. If defined, it will be presented to users after the failed execution of the command.")]
129 StringBuilder sb =
new StringBuilder();
131 foreach (
string s
in this.script)
134 this.parsedScript = Exp =
new Expression(sb.ToString());
149 List<ScriptParameterNode> Parameters =
new List<ScriptParameterNode>();
153 IEnumerable<INode> Children = await this.
ChildNodes;
154 if (!(Children is
null))
156 foreach (
INode Child
in Children)
159 Parameters.Add(ParameterNode);
164 return Parameters.ToArray();
Class managing a script expression.
Abstract base class for script node commands and queries.
string CommandId
ID of command
string Confirmation
Optional confirmation message.
string[] script
Unparsed script expression.
override bool ChildrenOrdered
If the children of the node have an intrinsic order (true), or if the order is not important (false).
async Task< ScriptParameterNode[]> GetParameters(VirtualNode Node)
Gets a node command based on the script command.
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
ScriptCommandNodeBase()
Represents a command that can be executed on a script node or script reference node.
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
string Success
Optional confirmation message.
Expression parsedScript
Parsed script expression.
string SortCategory
Sort category of command.
abstract Task< ICommand > GetCommand(VirtualNode Node)
Gets a node command based on the script command.
string CommandName
Displayable name of command
string SortKey
Sort key of command.
Expression ParsedScript
Parsed command script.
string Failure
Optional confirmation message.
Represents a parameter on a command.
Virtual node, that can be used as a placeholder for services.
Interface for nodes that are published through the concentrator interface.
bool HasChildren
If the source has any child sources.
Task< IEnumerable< INode > > ChildNodes
Child nodes. If no child nodes are available, null is returned.
INode Parent
Parent Node, or null if a root node.