Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Names.cs
1using System;
2using System.Reflection;
8
10{
15 {
25 {
26 }
27
31 public override string FunctionName => nameof(Names);
32
40 {
41 Type T;
42
44 T = TypeValue.Value;
45 else
46 T = Argument.AssociatedObjectValue?.GetType() ?? typeof(object);
47
48 if (!T.GetTypeInfo().IsEnum)
49 throw new ScriptRuntimeException("Argument is not an enumeration type of value.", this);
50
51 return new ObjectVector(Enum.GetNames(T));
52 }
53 }
54}
Class managing a script expression.
Definition: Expression.cs:39
Extract the names of an enumeration type or an enumeration object.
Definition: Names.cs:15
override IElement Evaluate(IElement Argument, Variables Variables)
Evaluates the function.
Definition: Names.cs:39
override string FunctionName
Name of the function
Definition: Names.cs:31
Names(ScriptNode Argument, int Start, int Length, Expression Expression)
Extract the names of an enumeration type or an enumeration object.
Definition: Names.cs:23
Base class for funcions of one variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20