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

Fixed bugs in NumericTextControl extension creators.

Changeset eb92ed3c1ce0

Parent 623f4c1ff013

by Profile picture of William GrossWilliam Gross

Changes to 2 files · Browse files at eb92ed3c1ce0 Showing diff from parent 623f4c1ff013 Diff from another changeset...

 
155
156
157
158
 
159
160
 
 
 
 
161
162
163
 
 
 
 
 
164
165
166
 
155
156
157
 
158
159
 
160
161
162
163
164
 
 
165
166
167
168
169
170
171
172
@@ -155,12 +155,18 @@
  maxLength: maxValue.Value.ToString( "D", CultureInfo.InvariantCulture ).Length,   validationMethod: ( postBackValue, validator ) => {   if( postBackValue.Any() ) { - if( !long.TryParse( postBackValue, NumberStyles.None, CultureInfo.InvariantCulture, out var result ) || result > maxValue.Value ) + if( !long.TryParse( postBackValue, NumberStyles.None, CultureInfo.InvariantCulture, out var result ) || result > maxValue.Value ) {   validator.NoteErrorAndAddMessage( "The value is too large." ); - else if( result < minValue.Value ) + setup.ValidationErrorNotifier?.Invoke(); + return; + } + if( result < minValue.Value ) {   validator.NoteErrorAndAddMessage( "The value is too small." ); - else - dataValue.Value = result; + setup.ValidationErrorNotifier?.Invoke(); + return; + } + + dataValue.Value = result;   }   else   dataValue.Value = null;
 
42
43
44
45
 
 
46
47
48
 
85
86
87
88
 
 
89
90
91
 
115
116
117
118
 
 
119
120
121
 
122
123
 
124
 
125
126
127
 
 
42
43
44
 
45
46
47
48
49
 
86
87
88
 
89
90
91
92
93
 
117
118
119
 
120
121
122
123
124
125
126
 
127
128
129
130
131
132
 
@@ -42,7 +42,8 @@
  pageModificationValue,   numericPageModificationValue,   validationPredicate, - validationErrorNotifier ) ); + validationErrorNotifier ), + validationErrorNotifier );   }     /// <summary> @@ -85,7 +86,8 @@
  pageModificationValue,   numericPageModificationValue,   validationPredicate, - validationErrorNotifier ) ); + validationErrorNotifier ), + validationErrorNotifier );   }     /// <summary> @@ -115,13 +117,16 @@
  null,   null,   validationPredicate, - validationErrorNotifier ) ); + validationErrorNotifier ), + validationErrorNotifier );   }     internal TextControlSetup TextControlSetup { get; } + internal Action ValidationErrorNotifier { get; }   - private NumericTextControlSetup( TextControlSetup textControlSetup ) { + private NumericTextControlSetup( TextControlSetup textControlSetup, Action validationErrorNotifier ) {   TextControlSetup = textControlSetup; + ValidationErrorNotifier = validationErrorNotifier;   }   }  } \ No newline at end of file