Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
StringParameterInfo.cs
2using System.Windows.Controls;
4
6{
11 {
12 private readonly Property<string> min;
13 private readonly Property<string> max;
14 private readonly Property<int?> maxLength;
15 private readonly Property<int?> minLength;
16 private readonly Property<string> regEx;
17
18 private StringParameter stringParameter;
19
20 private readonly Control minLengthControl;
21 private readonly Control maxLengthControl;
22 private readonly Control regExControl;
23
43 {
44 this.stringParameter = Parameter;
45
46 this.min = new Property<string>(nameof(this.Min), Parameter.Min, this);
47 this.max = new Property<string>(nameof(this.Max), Parameter.Max, this);
48 this.minLength = new Property<int?>(nameof(this.MinLength), Parameter.MinLength, this);
49 this.maxLength = new Property<int?>(nameof(this.MaxLength), Parameter.MaxLength, this);
50 this.regEx = new Property<string>(nameof(this.RegEx), Parameter.RegEx, this);
51
52 this.minLengthControl = MinLengthControl;
53 this.maxLengthControl = MaxLengthControl;
54 this.regExControl = RegExControl;
55
56 this.MinIncluded = Parameter.MinIncluded;
57 this.MaxIncluded = Parameter.MaxIncluded;
58 }
59
63 public string Min
64 {
65 get => this.min.Value;
66 set
67 {
68 this.stringParameter.Min = value;
69 this.min.Value = value;
70 this.Revalidate();
71 }
72 }
73
77 public string Max
78 {
79 get => this.max.Value;
80 set
81 {
82 this.stringParameter.Max = value;
83 this.max.Value = value;
84 this.Revalidate();
85 }
86 }
87
89 public override bool MinIncluded
90 {
91 get => base.MinIncluded;
92 set
93 {
94 this.stringParameter.MinIncluded = value;
95 base.MinIncluded = value;
96 }
97 }
98
100 public override bool MaxIncluded
101 {
102 get => base.MaxIncluded;
103 set
104 {
105 this.stringParameter.MaxIncluded = value;
106 base.MaxIncluded = value;
107 }
108 }
109
113 public int? MinLength
114 {
115 get => this.minLength.Value;
116 set
117 {
118 this.stringParameter.MinLength = value;
119 this.minLength.Value = value;
120 this.Revalidate();
121 }
122 }
123
127 public int? MaxLength
128 {
129 get => this.maxLength.Value;
130 set
131 {
132 this.stringParameter.MaxLength = value;
133 this.maxLength.Value = value;
134 this.Revalidate();
135 }
136 }
137
141 public string RegEx
142 {
143 get => this.regEx.Value;
144 set
145 {
146 this.stringParameter.RegEx = value;
147 this.regEx.Value = value;
148 this.Revalidate();
149 }
150 }
151
153 public override void SetMax(string Value)
154 {
155 this.Max = Value;
156 }
157
159 public override void SetMin(string Value)
160 {
161 this.Min = Value;
162 }
163
165 public override void SetValue(string Value)
166 {
167 this.Value = Value;
168 }
169
173 public override Control MinLengthControl => this.minLengthControl;
174
178 public override Control MaxLengthControl => this.maxLengthControl;
179
183 public override Control RegExControl => this.regExControl;
184
186 public override void ContractUpdated(Contract Contract)
187 {
188 base.ContractUpdated(Contract);
189 this.stringParameter = this.Parameter as StringParameter;
190 }
191
192 }
193}
Contains the definition of a contract
Definition: Contract.cs:22
Abstract base class for contractual parameters
Definition: Parameter.cs:17
String-valued contractual parameter
int? MinLength
Optional minimum length of value.
string RegEx
Optional regular expression to validate the value of the string parameter.
int? MaxLength
Optional maximum length of value.