Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
BooleanFieldToString.cs
1using System;
6
8{
13 {
18 {
19 }
20
24 public Type From => typeof(BooleanField);
25
29 public Type To => typeof(Boolean);
30
37 public object Convert(object Value)
38 {
39 if (Value is BooleanField Field)
40 return Field.Value;
41 else
42 throw new ArgumentException("Not a BooleanField.", nameof(Value));
43 }
44
52 public IElement ConvertToElement(object Value)
53 {
54 if (Value is BooleanField Field)
55 return new BooleanValue(Field.Value);
56 else
57 throw new ArgumentException("Not a BooleanField.", nameof(Value));
58 }
59 }
60}
Boolean-valued number.
Definition: BooleanValue.cs:12
Represents a boolean value that can be either true or false.
Definition: BooleanField.cs:11
Base class for all sensor data fields.
Definition: Field.cs:20
object Convert(object Value)
Converts the object in Value to an object of type To.
Type From
Converter converts objects of this type.
IElement ConvertToElement(object Value)
Converts the object in Value to an object of type To, encapsulated in an IElement.
BooleanFieldToBoolean()
Converts a BooleanField to a Boolean.
Type To
Converter converts objects to this type.
Basic interface for all types of elements.
Definition: IElement.cs:20
Converts an object of one type to an object of another type.