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
37
public
double
Weight
=> 0.5;
38
45
public
bool
TryConvert
(
object
Value, out
object
Result)
46
{
47
if
(Value is
DurationField
Field
)
48
{
49
Result =
Field
.Value;
50
return
true
;
51
}
52
else
53
{
54
Result =
null
;
55
return
false
;
56
}
57
}
58
66
public
bool
TryConvertToElement
(
object
Value, out
IElement
Result)
67
{
68
if
(Value is
DurationField
Field
)
69
{
70
Result =
new
ObjectValue
(
Field
.Value);
71
return
true
;
72
}
73
else
74
{
75
Result =
null
;
76
return
false
;
77
}
78
}
79
}
80
}
Waher.Script.Objects.ObjectValue
Object value.
Definition:
ObjectValue.cs:14
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.Weight
double Weight
Weight of the converter. An estimate of how well the converter performs, or how much information is r...
Definition:
DurationFieldToDuration.cs:37
Waher.Things.TypeConverters.DurationFieldToDuration.TryConvert
bool TryConvert(object Value, out object Result)
Converts the object in Value to an object of type To.
Definition:
DurationFieldToDuration.cs:45
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.DurationFieldToDuration
DurationFieldToDuration()
Converts a DurationField to a Duration.
Definition:
DurationFieldToDuration.cs:18
Waher.Things.TypeConverters.DurationFieldToDuration.TryConvertToElement
bool TryConvertToElement(object Value, out IElement Result)
Converts the object in Value to an object of type To, encapsulated in an IElement.
Definition:
DurationFieldToDuration.cs:66
Waher.Script.Abstraction.Elements.IElement
Basic interface for all types of elements.
Definition:
IElement.cs:21
Waher.Script.TypeConversion.ITypeConverter
Converts an object of one type to an object of another type.
Definition:
ITypeConverter.cs:11
System
Definition:
Adapters.g.cs:58
Waher.Content
Definition:
Array.cs:6
Waher.Script.Abstraction.Elements
Definition:
AbelianGroupElement.cs:4
Waher.Script.Objects
Definition:
BooleanValue.cs:7
Waher.Script.TypeConversion
Definition:
ConversionSequence.cs:5
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:14
IoTGateway
Things
Waher.Things
TypeConverters
DurationFieldToDuration.cs
Generated by
1.9.5