2using System.Threading.Tasks;
11 where T : struct, IComparable<T>
14 private T? min =
null;
15 private T? max =
null;
16 private bool minIncluded =
true;
17 private bool maxIncluded =
true;
28 this.ProtectedValue =
null;
38 set => this.min = value;
47 set => this.max = value;
55 get => this.minIncluded;
56 set => this.minIncluded = value;
64 get => this.maxIncluded;
65 set => this.maxIncluded = value;
92 if (!(this.
Value.HasValue))
95 this.ErrorText =
null;
97 return Task.FromResult(
false);
100 IComparable<T> Compare = this.
Value.Value;
102 if (this.
Min.HasValue)
104 Diff = Compare.CompareTo(this.
Min.Value);
109 this.ErrorText =
null;
111 return Task.FromResult(
false);
115 if (this.
Max.HasValue)
117 Diff = Compare.CompareTo(this.
Max.Value);
122 this.ErrorText =
null;
124 return Task.FromResult(
false);
128 return base.IsParameterValid(
Variables, Client);
Adds support for legal identities, smart contracts and signatures to an XMPP client.
Abstract base class for contractual parameters
string Name
Parameter name
Numerical contractual parameter
override void Populate(Variables Variables)
Populates a variable collection with the value of the parameter.
T? Min
Optional minimum value.
bool MinIncluded
If the optional minimum value is included in the allowed range.
T? Max
Optional maximum value.
bool MaxIncluded
If the optional maximum value is included in the allowed range.
override Task< bool > IsParameterValid(Variables Variables, ContractsClient Client)
Checks if the parameter value is valid.
override object ObjectValue
Parameter value.
ParameterErrorReason
Enumeration of different parameter validation reasons.