Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OnNote.cs
1using System.Threading.Tasks;
2using System.Xml;
6
8{
12 public abstract class OnNote : TokenEventNode
13 {
14 private ScriptableStringAttribute noteVariable;
15 private ScriptableStringAttribute personalVariable;
16
20 public OnNote()
21 : base()
22 {
23 }
24
28 [DefaultValueNull]
30 {
31 get => this.noteVariable?.Definition;
32 set => this.noteVariable = new ScriptableStringAttribute(value, this);
33 }
34
38 [DefaultValueNull]
40 {
41 get => this.personalVariable?.Definition;
42 set => this.personalVariable = new ScriptableStringAttribute(value, this);
43 }
44
49 public override Task Parse(XmlElement Xml)
50 {
51 this.noteVariable = new ScriptableStringAttribute(XML.Attribute(Xml, "noteVariable"), this);
52 this.personalVariable = new ScriptableStringAttribute(XML.Attribute(Xml, "personalVariable"), this);
53
54 return base.Parse(Xml);
55 }
56
62 protected Task<string> EvaluateNoteVariable(EvaluationArguments Arguments)
63 {
64 return this.noteVariable?.Evaluate(Arguments.Variables) ?? Task.FromResult<string>(null);
65 }
66
72 protected Task<string> EvaluatePersonalVariable(EvaluationArguments Arguments)
73 {
74 return this.personalVariable?.Evaluate(Arguments.Variables) ?? Task.FromResult<string>(null);
75 }
76 }
77}
Helps with common XML-related tasks.
Definition: XML.cs:19
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:914
async Task< T > Evaluate(Variables Variables)
Evaluates the attribute
Contains information required for evaluating script in a state-machine.
Abstract base class for note events.
Definition: OnNote.cs:13
Task< string > EvaluateNoteVariable(EvaluationArguments Arguments)
Evaluates the note variable definition.
Definition: OnNote.cs:62
OnNote()
Abstract base class for note events.
Definition: OnNote.cs:20
Task< string > EvaluatePersonalVariable(EvaluationArguments Arguments)
Evaluates the personal variable definition.
Definition: OnNote.cs:72
override Task Parse(XmlElement Xml)
Parses the State-machine node.
Definition: OnNote.cs:49
string PersonalVariableDefinition
Personal Variable definition.
Definition: OnNote.cs:40
string NoteVariableDefinition
Note Variable definition.
Definition: OnNote.cs:30