Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/18/20 16:28:53 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • added two new methods in IJsonItem -> FixatePath and LoosenPath to fixate/loosen the path (to enable name changing without effects on path)
  • set IsInRange to virtual and made overrides for IntMatrixJsonItem and DoubleMatrixJsonItem (IsInRange is a bad name and needs to be renamed in future versions)
  • implemented basic validation feedback with ErrorProvider for some inputs (templateName, Name, Range)
  • now all items gets validated before export (validation errors are shown with ErrorHandling.ShowErrorDialog)
  • added a check in AlgorithmConverter to prevent an exception for accessing the first element of an empty IEnumerable
Location:
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs

    r17443 r17444  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      this.components = new System.ComponentModel.Container();
    2627      this.labelEnable = new System.Windows.Forms.Label();
    2728      this.checkBoxActive = new System.Windows.Forms.CheckBox();
     
    3233      this.labelDescription = new System.Windows.Forms.Label();
    3334      this.textBoxDescription = new System.Windows.Forms.TextBox();
     35      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
     36      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    3437      this.SuspendLayout();
    3538      //
     
    7780      this.textBoxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7881            | System.Windows.Forms.AnchorStyles.Right)));
     82      this.errorProvider.SetIconAlignment(this.textBoxName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    7983      this.textBoxName.Location = new System.Drawing.Point(92, 23);
    8084      this.textBoxName.Name = "textBoxName";
    8185      this.textBoxName.Size = new System.Drawing.Size(402, 20);
    8286      this.textBoxName.TabIndex = 10;
     87      this.textBoxName.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxName_Validating);
    8388      //
    8489      // label1
     
    110115      this.textBoxDescription.TabIndex = 14;
    111116      //
     117      // errorProvider
     118      //
     119      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
     120      this.errorProvider.ContainerControl = this;
     121      //
    112122      // JsonItemBaseControl
    113123      //
     
    122132      this.Controls.Add(this.textBoxName);
    123133      this.Controls.Add(this.label1);
     134      this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    124135      this.Name = "JsonItemBaseControl";
    125136      this.Padding = new System.Windows.Forms.Padding(3);
    126137      this.Size = new System.Drawing.Size(500, 154);
     138      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    127139      this.ResumeLayout(false);
    128140      this.PerformLayout();
     
    140152    private System.Windows.Forms.Label labelDescription;
    141153    private System.Windows.Forms.TextBox textBoxDescription;
     154    protected System.Windows.Forms.ErrorProvider errorProvider;
    142155  }
    143156}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs

    r17443 r17444  
    3131      else
    3232        textBoxActualName.Text = VM.Item.ActualName;
    33        
     33
     34    }
     35
     36    private void textBoxName_Validating(object sender, CancelEventArgs e) {
     37      if(string.IsNullOrWhiteSpace(textBoxName.Text)) {
     38        errorProvider.SetError(textBoxName, "Name must not be empty.");
     39        e.Cancel = true;
     40      } else {
     41        errorProvider.SetError(textBoxName, null);
     42      }
    3443    }
    3544  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.resx

    r17404 r17444  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.Designer.cs

    r17411 r17444  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      this.components = new System.ComponentModel.Container();
    2627      this.textBoxFrom = new System.Windows.Forms.TextBox();
    2728      this.label6 = new System.Windows.Forms.Label();
    2829      this.groupBox2 = new System.Windows.Forms.GroupBox();
    29       this.checkBoxFrom = new System.Windows.Forms.CheckBox();
    3030      this.checkBoxTo = new System.Windows.Forms.CheckBox();
    3131      this.textBoxTo = new System.Windows.Forms.TextBox();
    3232      this.label1 = new System.Windows.Forms.Label();
     33      this.checkBoxFrom = new System.Windows.Forms.CheckBox();
     34      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    3335      this.groupBox2.SuspendLayout();
     36      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    3437      this.SuspendLayout();
    3538      //
     
    3841      this.textBoxFrom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    3942            | System.Windows.Forms.AnchorStyles.Right)));
    40       this.textBoxFrom.Location = new System.Drawing.Point(36, 36);
     43      this.errorProvider.SetIconAlignment(this.textBoxFrom, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     44      this.textBoxFrom.Location = new System.Drawing.Point(67, 17);
    4145      this.textBoxFrom.Name = "textBoxFrom";
    4246      this.textBoxFrom.ReadOnly = true;
    43       this.textBoxFrom.Size = new System.Drawing.Size(164, 20);
     47      this.textBoxFrom.Size = new System.Drawing.Size(253, 20);
    4448      this.textBoxFrom.TabIndex = 2;
     49      this.textBoxFrom.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxFrom_Validating);
    4550      //
    4651      // label6
     
    4954            | System.Windows.Forms.AnchorStyles.Right)));
    5055      this.label6.AutoSize = true;
    51       this.label6.Location = new System.Drawing.Point(7, 20);
     56      this.label6.Location = new System.Drawing.Point(31, 21);
    5257      this.label6.Name = "label6";
    5358      this.label6.Size = new System.Drawing.Size(30, 13);
     
    5762      // groupBox2
    5863      //
    59       this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    60             | System.Windows.Forms.AnchorStyles.Right)));
    6164      this.groupBox2.Controls.Add(this.checkBoxTo);
    6265      this.groupBox2.Controls.Add(this.textBoxTo);
     
    6568      this.groupBox2.Controls.Add(this.textBoxFrom);
    6669      this.groupBox2.Controls.Add(this.label6);
    67       this.groupBox2.Location = new System.Drawing.Point(0, 3);
     70      this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
     71      this.groupBox2.Location = new System.Drawing.Point(0, 0);
    6872      this.groupBox2.Name = "groupBox2";
    69       this.groupBox2.Size = new System.Drawing.Size(206, 109);
     73      this.groupBox2.Size = new System.Drawing.Size(326, 75);
    7074      this.groupBox2.TabIndex = 19;
    7175      this.groupBox2.TabStop = false;
    7276      this.groupBox2.Text = "Range";
    7377      //
    74       // checkBoxFrom
    75       //
    76       this.checkBoxFrom.AutoSize = true;
    77       this.checkBoxFrom.Location = new System.Drawing.Point(10, 39);
    78       this.checkBoxFrom.Name = "checkBoxFrom";
    79       this.checkBoxFrom.Size = new System.Drawing.Size(15, 14);
    80       this.checkBoxFrom.TabIndex = 4;
    81       this.checkBoxFrom.UseVisualStyleBackColor = true;
    82       //
    8378      // checkBoxTo
    8479      //
    8580      this.checkBoxTo.AutoSize = true;
    86       this.checkBoxTo.Location = new System.Drawing.Point(10, 78);
     81      this.checkBoxTo.Location = new System.Drawing.Point(10, 46);
    8782      this.checkBoxTo.Name = "checkBoxTo";
    8883      this.checkBoxTo.Size = new System.Drawing.Size(15, 14);
     
    9489      this.textBoxTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    9590            | System.Windows.Forms.AnchorStyles.Right)));
    96       this.textBoxTo.Location = new System.Drawing.Point(36, 75);
     91      this.errorProvider.SetIconAlignment(this.textBoxTo, System.Windows.Forms.ErrorIconAlignment.TopLeft);
     92      this.textBoxTo.Location = new System.Drawing.Point(67, 43);
    9793      this.textBoxTo.Name = "textBoxTo";
    9894      this.textBoxTo.ReadOnly = true;
    99       this.textBoxTo.Size = new System.Drawing.Size(164, 20);
     95      this.textBoxTo.Size = new System.Drawing.Size(253, 20);
    10096      this.textBoxTo.TabIndex = 6;
     97      this.textBoxTo.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxTo_Validating);
    10198      //
    10299      // label1
     
    105102            | System.Windows.Forms.AnchorStyles.Right)));
    106103      this.label1.AutoSize = true;
    107       this.label1.Location = new System.Drawing.Point(7, 59);
     104      this.label1.Location = new System.Drawing.Point(31, 46);
    108105      this.label1.Name = "label1";
    109106      this.label1.Size = new System.Drawing.Size(20, 13);
    110107      this.label1.TabIndex = 5;
    111108      this.label1.Text = "To";
     109      //
     110      // checkBoxFrom
     111      //
     112      this.checkBoxFrom.AutoSize = true;
     113      this.checkBoxFrom.Location = new System.Drawing.Point(10, 20);
     114      this.checkBoxFrom.Name = "checkBoxFrom";
     115      this.checkBoxFrom.Size = new System.Drawing.Size(15, 14);
     116      this.checkBoxFrom.TabIndex = 4;
     117      this.checkBoxFrom.UseVisualStyleBackColor = true;
     118      //
     119      // errorProvider
     120      //
     121      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
     122      this.errorProvider.ContainerControl = this;
    112123      //
    113124      // NumericRangeControl
     
    117128      this.Controls.Add(this.groupBox2);
    118129      this.Name = "NumericRangeControl";
    119       this.Size = new System.Drawing.Size(206, 112);
     130      this.Size = new System.Drawing.Size(326, 75);
    120131      this.groupBox2.ResumeLayout(false);
    121132      this.groupBox2.PerformLayout();
     133      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    122134      this.ResumeLayout(false);
    123135
     
    132144    private System.Windows.Forms.Label label1;
    133145    private System.Windows.Forms.CheckBox checkBoxFrom;
     146    private System.Windows.Forms.ErrorProvider errorProvider;
    134147  }
    135148}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.cs

    r17411 r17444  
    3333      textBoxFrom.ReadOnly = !checkBoxFrom.Checked;
    3434    }
     35
     36    private void textBoxFrom_Validating(object sender, CancelEventArgs e) {
     37      if (string.IsNullOrWhiteSpace(textBoxFrom.Text)) {
     38        errorProvider.SetError(textBoxFrom, "'From' must not be empty.");
     39        e.Cancel = true;
     40      } else {
     41        errorProvider.SetError(textBoxFrom, null);
     42      }
     43    }
     44
     45    private void textBoxTo_Validating(object sender, CancelEventArgs e) {
     46      if (string.IsNullOrWhiteSpace(textBoxTo.Text)) {
     47        errorProvider.SetError(textBoxTo, "'To' must not be empty.");
     48        e.Cancel = true;
     49      } else {
     50        errorProvider.SetError(textBoxTo, null);
     51      }
     52    }
    3553  }
    3654}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.resx

    r17405 r17444  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
Note: See TracChangeset for help on using the changeset viewer.