Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Int32FieldToInt32.cs
1using System;
6
8{
13 {
18 {
19 }
20
24 public Type From => typeof(Int32Field);
25
29 public Type To => typeof(int);
30
36 public double Weight => 0.5;
37
44 public bool TryConvert(object Value, out object Result)
45 {
46 if (Value is Int32Field Field)
47 {
48 Result = Field.Value;
49 return true;
50 }
51 else
52 {
53 Result = null;
54 return false;
55 }
56 }
57
65 public bool TryConvertToElement(object Value, out IElement Result)
66 {
67 if (Value is Int32Field Field)
68 {
69 Result = new ObjectValue(Field.Value);
70 return true;
71 }
72 else
73 {
74 Result = null;
75 return false;
76 }
77 }
78 }
79}
Base class for all sensor data fields.
Definition: Field.cs:20
Represents a 32-bit integer value.
Definition: Int32Field.cs:10
Type To
Converter converts objects to this type.
double Weight
Weight of the converter. An estimate of how well the converter performs, or how much information is r...
Type From
Converter converts objects of this type.
bool TryConvertToElement(object Value, out IElement Result)
Converts the object in Value to an object of type To, encapsulated in an IElement.
Int32FieldToInt32()
Converts a Int32Field to a Int32.
bool TryConvert(object Value, out object Result)
Converts the object in Value to an object of type To.
Basic interface for all types of elements.
Definition: IElement.cs:21
Converts an object of one type to an object of another type.