Changeset 17485 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemMultiValueControl.cs
- Timestamp:
- 03/23/20 16:40:16 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemMultiValueControl.cs
r17484 r17485 182 182 #region Validation 183 183 private void textBoxRows_Validating(object sender, CancelEventArgs e) { 184 if (string.IsNullOrWhiteSpace(textBoxRows.Text)) { 185 errorProvider.SetError(textBoxRows, "'Rows' must not be empty."); 186 e.Cancel = true; 187 } else if (!int.TryParse(textBoxRows.Text, out int r)) { 188 errorProvider.SetError(textBoxRows, "Value of 'Rows' must be an integer."); 189 e.Cancel = true; 190 } else if (r == 0) { 191 errorProvider.SetError(textBoxRows, "Value of 'Rows' must be an integer larger than 0."); 192 e.Cancel = true; 193 } else { 184 if (textBoxRows.ReadOnly) { 194 185 errorProvider.SetError(textBoxRows, null); 186 } else { 187 if (string.IsNullOrWhiteSpace(textBoxRows.Text)) { 188 errorProvider.SetError(textBoxRows, "'Rows' must not be empty."); 189 e.Cancel = true; 190 } else if (!int.TryParse(textBoxRows.Text, out int r)) { 191 errorProvider.SetError(textBoxRows, "Value of 'Rows' must be an integer."); 192 e.Cancel = true; 193 } else if (r == 0) { 194 errorProvider.SetError(textBoxRows, "Value of 'Rows' must be an integer larger than 0."); 195 e.Cancel = true; 196 } else { 197 errorProvider.SetError(textBoxRows, null); 198 } 195 199 } 196 200 } 197 201 198 202 private void textBoxColumns_Validating(object sender, CancelEventArgs e) { 199 if (string.IsNullOrWhiteSpace(textBoxColumns.Text)) { 200 errorProvider.SetError(textBoxColumns, "'Columns' must not be empty."); 201 e.Cancel = true; 202 } else if (!int.TryParse(textBoxColumns.Text, out int r)) { 203 errorProvider.SetError(textBoxColumns, "Value of 'Columns' must be an integer."); 204 e.Cancel = true; 205 } else if (r == 0) { 206 errorProvider.SetError(textBoxColumns, "Value of 'Columns' must be an integer larger than 0."); 207 e.Cancel = true; 208 } else { 203 if (textBoxColumns.ReadOnly) { 209 204 errorProvider.SetError(textBoxColumns, null); 205 } else { 206 if (string.IsNullOrWhiteSpace(textBoxColumns.Text)) { 207 errorProvider.SetError(textBoxColumns, "'Columns' must not be empty."); 208 e.Cancel = true; 209 } else if (!int.TryParse(textBoxColumns.Text, out int r)) { 210 errorProvider.SetError(textBoxColumns, "Value of 'Columns' must be an integer."); 211 e.Cancel = true; 212 } else if (r == 0) { 213 errorProvider.SetError(textBoxColumns, "Value of 'Columns' must be an integer larger than 0."); 214 e.Cancel = true; 215 } else { 216 errorProvider.SetError(textBoxColumns, null); 217 } 210 218 } 211 219 }
Note: See TracChangeset
for help on using the changeset viewer.