Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ScriptableDecimalAttribute.cs
1
using
System;
2
using
Waher.Content
;
3
4
namespace
Waher.Service.IoTBroker.StateMachines.Model.Attributes
5
{
9
public
class
ScriptableDecimalAttribute
:
ScriptableAttribute
<decimal>
10
{
16
public
ScriptableDecimalAttribute
(
string
Definition
,
StateMachineNode
Node)
17
: base(
Definition
, Node)
18
{
19
}
20
26
public
override
decimal
ParseValue
(
string
s)
27
{
28
if
(
CommonTypes
.
TryParse
(s, out decimal d))
29
return
d;
30
else
31
throw
new
ArgumentException(
"Invalid decimal value."
, nameof(s));
32
}
33
}
34
}
Waher.Content.CommonTypes
Helps with parsing of commong data types.
Definition:
CommonTypes.cs:13
Waher.Content.CommonTypes.TryParse
static bool TryParse(string s, out double Value)
Tries to decode a string encoded double.
Definition:
CommonTypes.cs:46
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableAttribute
Abstract base class for scriptable attributes.
Definition:
ScriptableAttribute.cs:14
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableAttribute< decimal >::Definition
string Definition
Attribute definition
Definition:
ScriptableAttribute.cs:37
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableDecimalAttribute
Scriptable string attribute.
Definition:
ScriptableDecimalAttribute.cs:10
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableDecimalAttribute.ParseValue
override decimal ParseValue(string s)
Parses a string representation of a value.
Definition:
ScriptableDecimalAttribute.cs:26
Waher.Service.IoTBroker.StateMachines.Model.Attributes.ScriptableDecimalAttribute.ScriptableDecimalAttribute
ScriptableDecimalAttribute(string Definition, StateMachineNode Node)
Scriptable string attribute.
Definition:
ScriptableDecimalAttribute.cs:16
Waher.Service.IoTBroker.StateMachines.Model.StateMachineNode
Abstract base class for State-Machine nodes.
Definition:
StateMachineNode.cs:24
Waher.Content
Definition:
Array.cs:6
Waher.Service.IoTBroker.StateMachines.Model.Attributes
Definition:
ExpressionAttribute.cs:9
Waher.Service.IoTBroker
StateMachines
Model
Attributes
ScriptableDecimalAttribute.cs
Generated by
1.9.5