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
using
Waher.Service.IoTBroker.StateMachines.Exceptions
;
6
7
namespace
Waher.Service.IoTBroker.StateMachines.Model.Values
8
{
12
public
class
Date
:
ValueNode
13
{
17
public
Date
()
18
: base()
19
{
20
}
21
25
public
System.DateTime
Value
{
get
;
set
; }
26
30
public
override
string
LocalName
=> nameof(
Date
);
31
36
public
override
IStateMachineNode
Create
()
37
{
38
return
new
Date
();
39
}
40
45
public
override
Task
Parse
(XmlElement Xml)
46
{
47
if
(!
XML
.
TryParse
(Xml.InnerText, out
System
.DateTime TP))
48
throw
new
StateMachineException
(this.
StateMachine
,
"Invalid DateTime value."
);
49
50
if
(TP.TimeOfDay != TimeSpan.Zero)
51
throw
new
StateMachineException
(this.
StateMachine
,
"Invalid Date value."
);
52
53
this.Value = TP;
54
55
return
base.Parse(Xml);
56
}
57
62
public
override
Task<object>
Evaluate
(
EvaluationArguments
Arguments)
63
{
64
return
Task.FromResult<
object
>(this.
Value
);
65
}
66
}
67
}
Waher.Content.Xml.XML
Helps with common XML-related tasks.
Definition:
XML.cs:21
Waher.Content.Xml.XML.TryParse
static bool TryParse(string s, out DateTime Value)
Tries to decode a string encoded DateTime.
Definition:
XML.cs:892
Waher.Service.IoTBroker.StateMachines.Exceptions.StateMachineException
Exception related to state machine.
Definition:
StateMachineException.cs:10
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:13
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Create
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Definition:
Date.cs:36
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Value
System.DateTime Value
Value
Definition:
Date.cs:25
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.LocalName
override string LocalName
Local name
Definition:
Date.cs:30
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Evaluate
override Task< object > Evaluate(EvaluationArguments Arguments)
Evaluates the value node.
Definition:
Date.cs:62
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Date
Date()
Date value.
Definition:
Date.cs:17
Waher.Service.IoTBroker.StateMachines.Model.Values.Date.Parse
override Task Parse(XmlElement Xml)
Parses the State-machine node.
Definition:
Date.cs:45
Waher.Service.IoTBroker.StateMachines.Model.Values.Value
Abstract base class for nodes with a value.
Definition:
Value.cs:14
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.StateMachine
Class representing a state machine.
Definition:
StateMachine.cs:43
Waher.Service.IoTBroker.StateMachines.Model.IStateMachineNode
Interface for State-Machine nodes
Definition:
IStateMachineNode.cs:11
System
Definition:
Adapters.g.cs:58
Waher.Content.Xml
Definition:
Attribute.cs:7
Waher.Service.IoTBroker.StateMachines.Exceptions
Definition:
StateMachineErrorException.cs:2
Waher.Service.IoTBroker.StateMachines.Model.Values
Definition:
Binary.cs:7
Waher.Service.IoTBroker
StateMachines
Model
Values
Date.cs
Generated by
1.9.5