Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OnDateTime.cs
1using System.Threading.Tasks;
2using System.Xml;
5
7{
12 {
13 private ScriptableDateTimeAttribute value;
14
18 public OnDateTime()
19 : base()
20 {
21 }
22
26 [DefaultValueNull]
27 public string ValueDefinition
28 {
29 get => this.value?.Definition;
30 set => this.value = new ScriptableDateTimeAttribute(value, this);
31 }
32
36 public override string LocalName => nameof(OnDateTime);
37
42 public override IStateMachineNode Create()
43 {
44 return new OnDateTime();
45 }
46
51 public override Task Parse(XmlElement Xml)
52 {
53 this.value = new ScriptableDateTimeAttribute(Xml.InnerText, this);
54
55 return base.Parse(Xml);
56 }
57
63 public override async Task<EventTimepoint> GetEventTimepoint(EvaluationArguments Arguments)
64 {
65 if (this.value is null)
66 return new EventTimepoint();
67 else
68 return new EventTimepoint(await this.value.Evaluate(Arguments.Variables));
69 }
70
74 public override string Label => this.value.Definition;
75 }
76}
async Task< T > Evaluate(Variables Variables)
Evaluates the attribute
Contains information required for evaluating script in a state-machine.
Event raised after a certain date and time.
Definition: OnDateTime.cs:12
override Task Parse(XmlElement Xml)
Parses the State-machine node.
Definition: OnDateTime.cs:51
override async Task< EventTimepoint > GetEventTimepoint(EvaluationArguments Arguments)
Gets the timepoint for when the event elapses.
Definition: OnDateTime.cs:63
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition: OnDateTime.cs:42
OnDateTime()
Event raised after a certain date and time.
Definition: OnDateTime.cs:18
Abstract base class for timed State-Machine event nodes.