Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Int64Attribute.cs
1using System.Xml;
2using Waher.Script;
3
5{
9 public class Int64Attribute : Attribute<long>
10 {
16 public Int64Attribute(string AttributeName, long Value)
17 : base(AttributeName, Value)
18 {
19 }
20
26 public Int64Attribute(XmlElement E, string AttributeName)
27 : base(E, AttributeName, true)
28 {
29 }
30
36 public Int64Attribute(string AttributeName, Expression Expression)
37 : base(AttributeName, Expression)
38 {
39 }
40
47 public override bool TryConvert(object Result, out long Value)
48 {
49 if (Result is double d)
50 {
51 Value = (long)d;
52 return true;
53 }
54 else
55 return base.TryConvert(Result, out Value);
56 }
57
64 public override bool TryParse(string StringValue, out long Value)
65 {
66 return long.TryParse(StringValue, out Value);
67 }
68
74 public override string ToString(long Value)
75 {
76 return Value.ToString();
77 }
78 }
79}
Manages an attribute value or expression.
Definition: Attribute.cs:13
override string ToString(long Value)
Converts a value to a string.
Int64Attribute(string AttributeName, Expression Expression)
64-bit integer attribute
Int64Attribute(XmlElement E, string AttributeName)
64-bit integer attribute
Int64Attribute(string AttributeName, long Value)
64-bit integer attribute
override bool TryParse(string StringValue, out long Value)
Tries to parse a string value
override bool TryConvert(object Result, out long Value)
Tries to convert script result to a value of type long.
Class managing a script expression.
Definition: Expression.cs:41