Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/20 16:40:16 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • fixed a bug in ConstrainedValueParameterConverter -> added an extra check to get the correct child
  • fixed a bug in JsonItemValidator -> now the error messages get appended correctly
  • fixed a validation bug in JsonItemMultiValueControl -> now it should not validate a readonly textbox anymore
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemMultiValueControl.cs

    r17484 r17485  
    182182    #region Validation
    183183    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) {
    194185        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        }
    195199      }
    196200    }
    197201
    198202    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) {
    209204        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        }
    210218      }
    211219    }
Note: See TracChangeset for help on using the changeset viewer.