Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/20 14:53:45 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • deleted JsonItemArrayControl and JsonItemDefaultControl
  • redesigned architecture for JsonItem: now there are different types of JsonItem (IntJsonItem, BoolJsonItem, ...) -> for better type safety and expandability
  • fixed bug in BaseConverter for GetMinValue and GetMaxValue for IntValue, but ignored for other value types (DoubleValue, DateTimeValue, ...) because the redesign of JsonItem-Architecture can make these two methods obsolet soon
  • fixed bug in JsonItemConverter to prevent null pointer exceptions
  • refactored value and range converters -> removed complicated generic ValueTypeValueConverter and ValueRangeConverter and implemented the necessary methods directly in concrete classes (improves readability and removes the need of reflection)
  • redesigned view handling in OptimizerIntegration -> dynamically seaches for JsonItemVMBase implementations, which are connected with a view
    • this enables better scaling with more user controls
  • JsonItemVMBase implements MVVM architecture
Location:
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared
Files:
4 edited

Legend:

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

    r17405 r17410  
    5151      this.checkBoxActive.TabIndex = 2;
    5252      this.checkBoxActive.UseVisualStyleBackColor = true;
    53       this.checkBoxActive.CheckedChanged += new System.EventHandler(this.checkBoxActive_CheckedChanged);
    5453      //
    5554      // textBoxActualName
     
    6160      this.textBoxActualName.Size = new System.Drawing.Size(404, 20);
    6261      this.textBoxActualName.TabIndex = 12;
    63       this.textBoxActualName.TextChanged += new System.EventHandler(this.textBoxActualName_TextChanged);
    6462      //
    6563      // labelActualName
     
    8280      this.textBoxName.Size = new System.Drawing.Size(404, 20);
    8381      this.textBoxName.TabIndex = 10;
    84       this.textBoxName.TextChanged += new System.EventHandler(this.textBoxName_TextChanged);
    8582      //
    8683      // label1
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs

    r17405 r17410  
    1111namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    1212  public partial class JsonItemBaseControl : UserControl {
    13     public JsonItemVM VM { get; set; }
     13    private JsonItemVMBase VM { get; set; }
    1414
    1515    private JsonItemBaseControl() {
     
    1717    }
    1818
    19     public JsonItemBaseControl(JsonItemVM vm) {
     19    public JsonItemBaseControl(JsonItemVMBase vm) {
    2020      InitializeComponent();
    2121      VM = vm;
    22       checkBoxActive.Checked = VM.Selected;
    23       textBoxName.Text = VM.Item.Name;
     22
     23      checkBoxActive.DataBindings.Add("Checked", VM, nameof(JsonItemVMBase.Selected));
     24      textBoxName.DataBindings.Add("Text", VM, nameof(JsonItemVMBase.Name));
     25      textBoxActualName.DataBindings.Add("Text", VM, nameof(JsonItemVMBase.ActualName));
     26
     27      //checkBoxActive.Checked = VM.Selected;
     28      //textBoxName.Text = VM.Item.Name;
    2429      if (string.IsNullOrWhiteSpace(VM.Item.ActualName))
    2530        textBoxActualName.ReadOnly = true;
     
    2732        textBoxActualName.Text = VM.Item.ActualName;
    2833    }
    29 
    30     private void checkBoxActive_CheckedChanged(object sender, EventArgs e) {
    31       VM.Selected = checkBoxActive.Checked;
    32     }
    33 
    34     private void textBoxName_TextChanged(object sender, EventArgs e) {
    35       VM.Item.Name = textBoxName.Text;
    36     }
    37 
    38     private void textBoxActualName_TextChanged(object sender, EventArgs e) {
    39       VM.Item.ActualName = textBoxActualName.Text;
    40     }
    4134  }
    4235}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.Designer.cs

    r17405 r17410  
    1 namespace HeuristicLab.JsonInterface.OptimizerIntegration.Shared {
     1namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    22  partial class NumericRangeControl {
    33    /// <summary>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.cs

    r17405 r17410  
    1010using System.Globalization;
    1111
    12 namespace HeuristicLab.JsonInterface.OptimizerIntegration.Shared {
     12namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    1313  public partial class NumericRangeControl : UserControl {
    1414
     
    2222    }
    2323    public bool IsDouble { get; set; }
    24 
    25 
    2624
    2725    public NumericRangeControl() {
Note: See TracChangeset for help on using the changeset viewer.