Ewl » Canonical The canonical version of EWL Read More
Clone URL:  
Pushed to 3 repositories · View In Graph Contained in tip and canonical

Fixed min/max bugs in FormControlExtensionCreators.

Changeset a1ccca776871

Parent aafd23de47e1

by Profile picture of William GrossWilliam Gross

Changes to one file · Browse files at a1ccca776871 Showing diff from parent aafd23de47e1 Diff from another changeset...

 
94
95
96
97
98
 
 
99
100
101
102
 
103
104
 
105
106
107
 
197
198
199
200
201
 
 
202
203
204
 
229
230
231
232
233
 
 
234
235
236
 
261
262
263
264
265
 
 
266
267
268
 
293
294
295
296
297
 
 
298
299
300
 
94
95
96
 
 
97
98
99
100
101
 
102
103
 
104
105
106
107
 
197
198
199
 
 
200
201
202
203
204
 
229
230
231
 
 
232
233
234
235
236
 
261
262
263
 
 
264
265
266
267
268
 
293
294
295
 
 
296
297
298
299
300
@@ -94,14 +94,14 @@
  public static NumericTextControl ToTextControl(   this DataValue<int> dataValue, NumericTextControlSetup setup = null, SpecifiedValue<int?> value = null, int? minValue = null, int? maxValue = null,   Action<Validator> additionalValidationMethod = null ) { - var longValue = new DataValue<long?> { Value = value != null ? value.Value : dataValue.Value }; - return longValue.ToTextControl( + var nullableValue = new DataValue<int?> { Value = value != null ? value.Value : dataValue.Value }; + return nullableValue.ToTextControl(   setup: setup,   allowEmpty: false,   minValue: minValue, - maxValue: maxValue ?? int.MaxValue, + maxValue: maxValue,   additionalValidationMethod: validator => { - dataValue.Value = (int)longValue.Value.Value; + dataValue.Value = nullableValue.Value.Value;   additionalValidationMethod?.Invoke( validator );   } );   } @@ -197,8 +197,8 @@
  return longValue.ToNumberControl(   setup: setup,   allowEmpty: allowEmpty, - minValue: minValue, - maxValue: maxValue, + minValue: minValue ?? int.MinValue, + maxValue: maxValue ?? int.MaxValue,   valueStep: valueStep,   additionalValidationMethod: validator => {   dataValue.Value = (int?)longValue.Value; @@ -229,8 +229,8 @@
  return decimalValue.ToNumberControl(   setup: setup,   allowEmpty: allowEmpty, - minValue: minValue, - maxValue: maxValue, + minValue: minValue ?? long.MinValue, + maxValue: maxValue ?? long.MaxValue,   valueStep: valueStep ?? 1,   additionalValidationMethod: validator => {   dataValue.Value = (long?)decimalValue.Value; @@ -261,8 +261,8 @@
  return longValue.ToNumberControl(   setup: setup,   allowEmpty: allowEmpty, - minValue: minValue, - maxValue: maxValue, + minValue: minValue ?? short.MinValue, + maxValue: maxValue ?? short.MaxValue,   valueStep: valueStep,   additionalValidationMethod: validator => {   dataValue.Value = (short?)longValue.Value; @@ -293,8 +293,8 @@
  return longValue.ToNumberControl(   setup: setup,   allowEmpty: allowEmpty, - minValue: minValue, - maxValue: maxValue, + minValue: minValue ?? byte.MinValue, + maxValue: maxValue ?? byte.MaxValue,   valueStep: valueStep,   additionalValidationMethod: validator => {   dataValue.Value = (byte?)longValue.Value;