Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DurationFieldToDuration.cs
1
using
System;
2
using
Waher.Content
;
3
using
Waher.Script.Abstraction.Elements
;
4
using
Waher.Script.Objects
;
5
using
Waher.Script.TypeConversion
;
6
using
Waher.Things.SensorData
;
7
8
namespace
Waher.Things.TypeConverters
9
{
13
public
class
DurationFieldToDuration
:
ITypeConverter
14
{
18
public
DurationFieldToDuration
()
19
{
20
}
21
25
public
Type
From
=> typeof(
DurationField
);
26
30
public
Type
To
=> typeof(
Duration
);
31
38
public
object
Convert
(
object
Value)
39
{
40
if
(Value is
DurationField
Field
)
41
return
Field
.Value;
42
else
43
throw
new
ArgumentException(
"Not a DurationField."
, nameof(Value));
44
}
45
53
public
IElement
ConvertToElement
(
object
Value)
54
{
55
if
(Value is
DurationField
Field
)
56
return
new
ObjectValue
(
Field
.Value);
57
else
58
throw
new
ArgumentException(
"Not a DurationField."
, nameof(Value));
59
}
60
}
61
}
Waher.Script.Objects.ObjectValue
Object value.
Definition:
ObjectValue.cs:12
Waher.Things.SensorData.DurationField
Represents a duration value. Duration values adhere to the type specified by xsd:duration.
Definition:
DurationField.cs:15
Waher.Things.SensorData.Field
Base class for all sensor data fields.
Definition:
Field.cs:20
Waher.Things.TypeConverters.DurationFieldToDuration
Converts a DurationField to a Duration.
Definition:
DurationFieldToDuration.cs:14
Waher.Things.TypeConverters.DurationFieldToDuration.Convert
object Convert(object Value)
Converts the object in Value to an object of type To.
Definition:
DurationFieldToDuration.cs:38
Waher.Things.TypeConverters.DurationFieldToDuration.From
Type From
Converter converts objects of this type.
Definition:
DurationFieldToDuration.cs:25
Waher.Things.TypeConverters.DurationFieldToDuration.To
Type To
Converter converts objects to this type.
Definition:
DurationFieldToDuration.cs:30
Waher.Things.TypeConverters.DurationFieldToDuration.ConvertToElement
IElement ConvertToElement(object Value)
Converts the object in Value to an object of type To, encapsulated in an IElement.
Definition:
DurationFieldToDuration.cs:53
Waher.Things.TypeConverters.DurationFieldToDuration.DurationFieldToDuration
DurationFieldToDuration()
Converts a DurationField to a Duration.
Definition:
DurationFieldToDuration.cs:18
Waher.Script.Abstraction.Elements.IElement
Basic interface for all types of elements.
Definition:
IElement.cs:20
Waher.Script.TypeConversion.ITypeConverter
Converts an object of one type to an object of another type.
Definition:
ITypeConverter.cs:10
Waher.Content
Definition:
Array.cs:6
Waher.Script.Abstraction.Elements
Definition:
AbelianGroupElement.cs:5
Waher.Script.Objects
Definition:
BooleanValue.cs:7
Waher.Script.TypeConversion
Definition:
BigIntegerToDouble.cs:7
Waher.Things.SensorData
Definition:
BooleanField.cs:6
Waher.Things.TypeConverters
Definition:
BooleanFieldToString.cs:8
Waher.Content.Duration
Represents a duration value, as defined by the xsd:duration data type: http://www....
Definition:
Duration.cs:13
IoTGateway
Things
Waher.Things
TypeConverters
DurationFieldToDuration.cs
Generated by
1.9.5