Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Int8ToDouble.cs
1using System;
4
6{
11 {
15 public Type From => typeof(sbyte);
16
20 public Type To => typeof(double);
21
28 public object Convert(object Value)
29 {
30 if (Value is sbyte d)
31 return (double)d;
32 else
33 throw new ArgumentException("Expected sbyte value.", nameof(Value));
34 }
35
43 public IElement ConvertToElement(object Value)
44 {
45 if (Value is sbyte d)
46 return new ObjectValue((double)d);
47 else
48 throw new ArgumentException("Expected sbyte value.", nameof(Value));
49 }
50 }
51}
Converts sbyte numbers to double numbers.
Definition: Int8ToDouble.cs:11
Type From
Converts double numbers to sbyte numbers.
Definition: Int8ToDouble.cs:15
IElement ConvertToElement(object Value)
Converts the object in Value to an object of type To, encapsulated in an IElement.
Definition: Int8ToDouble.cs:43
Type To
Converter converts objects to this type.
Definition: Int8ToDouble.cs:20
object Convert(object Value)
Converts the object in Value to an object of type To.
Definition: Int8ToDouble.cs:28
Basic interface for all types of elements.
Definition: IElement.cs:20
Converts an object of one type to an object of another type.