Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Date.cs
1
using
System;
2
using
System.Threading.Tasks;
3
using
System.Xml;
4
using
Waher.Content.Xml
;
5
6
namespace
Waher.Service.IoTBroker.StateMachines.Model.Values
7
{
11
public
class
Date
:
ValueNode
12
{
16
public
Date
()
17
: base()
18
{
19
}
20
24
public
System.DateTime
Value
{
get
;
set
; }
25
29
public
override
string
LocalName
=> nameof(
Date
);
30
35
public
override
IStateMachineNode
Create
()
36
{
37
return
new
Date
();
38
}
39
44
public
override
Task
Parse
(XmlElement Xml)
45
{
46
if
(!
XML
.
TryParse
(Xml.InnerText, out System.DateTime TP))
47
throw
new
Exception(
"Invalid DateTime value."
);
48
49
if
(TP.TimeOfDay != TimeSpan.Zero)
50
throw
new
Exception(
"Invalid Date value."
);
51
52
this.Value = TP;
53
54
return
base.Parse(Xml);
55
}
56
61
public
override
Task<object>
Evaluate
(
EvaluationArguments
Arguments)
62
{
63
return
Task.FromResult<
object
>(this.
Value
);
64
}
65
}
66
}
Waher.Content.Xml.XML
Helps with common XML-related tasks.
Definition:
XML.cs:19
Waher.Content.Xml.XML.TryParse
static bool TryParse(string s, out DateTime Value)
Tries to decode a string encoded DateTime.
Definition:
XML.cs:744
Waher.Service.IoTBroker.StateMachines.Model.EvaluationArguments
Contains information required for evaluating script in a state-machine.
Definition:
EvaluationArguments.cs:15
Waher.Service.IoTBroker.StateMachines.Model.Values.Date
Date value.
Definition:
Date.cs:12
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Create
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition:
Date.cs:35
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Value
System.DateTime Value
Value
Definition:
Date.cs:24
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.LocalName
override string LocalName
Local name
Definition:
Date.cs:29
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Evaluate
override Task< object > Evaluate(EvaluationArguments Arguments)
Evaluates the value node.
Definition:
Date.cs:61
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Date
Date()
Date value.
Definition:
Date.cs:16
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Parse
override Task Parse(XmlElement Xml)
Parses the State-machine node.
Definition:
Date.cs:44
Waher.Service.IoTBroker.StateMachines.Model.Values.Value
Abstract base class for nodes with a value.
Definition:
Value.cs:13
Waher.Service.IoTBroker.StateMachines.Model.Values.ValueNode
Abstract base class for State-Machine nodes containing a value.
Definition:
ValueNode.cs:9
Waher.Service.IoTBroker.StateMachines.Model.IStateMachineNode
Interface for State-Machine nodes
Definition:
IStateMachineNode.cs:11
Waher.Content.Xml
Definition:
XmlCodec.cs:11
Waher.Service.IoTBroker.StateMachines.Model.Values
Definition:
Binary.cs:7
Waher.Service.IoTBroker
StateMachines
Model
Values
Date.cs
Generated by
1.9.5