Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17828


Ignore:
Timestamp:
02/01/21 14:37:18 (4 years ago)
Author:
dpiringe
Message:

#3026

  • removed the option to set the value for JsonItems via exporter
    • reworked some base controls
    • added new controls for JsonItem specific properties (e.g. ArrayResizable)
    • deleted a lot of obsolet controls
  • removed the Enable checkbox in the detail view of JsonItems
  • exporter now clones the IOptimizer object
  • added a check + message for unsupported exports
  • list of JsonItems now includes unsupported JsonItems (disabled and marked with 'unsupported')
  • refactored the converter type check
    • now every converter has to specify its supported type(s)
Location:
branches/3026_IntegrationIntoSymSpace
Files:
10 added
21 deleted
50 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.App/JsonInterfaceForm.cs

    r17599 r17828  
    3737      this.configOpenButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
    3838      this.outputOpenButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Save;
     39      this.Icon = HeuristicLab.Common.Resources.HeuristicLab.Icon;
    3940    }
    4041
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.App/Runner.cs

    r17560 r17828  
    3333        WriteResultsToFile(outputFile, optimizer, configuredResultItem);
    3434      } catch (Exception e) {
     35        Console.Error.WriteLine($"{e.Message} \n\n\n\n {e.StackTrace}");
    3536        File.WriteAllText(outputFile, e.Message + "\n\n\n\n" + e.StackTrace);
     37        Environment.Exit(-1);
    3638      }
    3739    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/FileManager.cs

    r17477 r17828  
    2626      IStorableContent content = view.Content as IStorableContent;
    2727      if (!view.Locked && content != null) {
    28         exportDialog.Content = content;
    29         exportDialog.ShowDialog();
     28        if(content is IOptimizer) {
     29          exportDialog.Content = content;
     30          exportDialog.ShowDialog();
     31        } else {
     32          MessageBox.Show("This cannot item cannot be converted.", "Unsupported Item", MessageBoxButtons.OK);
     33        }
    3034      }
    3135    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/HeuristicLab.JsonInterface.OptimizerIntegration.csproj

    r17519 r17828  
    9595      <DependentUpon>Resources.resx</DependentUpon>
    9696    </Compile>
     97    <Compile Include="Shared\ArrayJsonItemControl.cs">
     98      <SubType>UserControl</SubType>
     99    </Compile>
     100    <Compile Include="Shared\ArrayJsonItemControl.Designer.cs">
     101      <DependentUpon>ArrayJsonItemControl.cs</DependentUpon>
     102    </Compile>
     103    <Compile Include="Shared\CompoundControl.cs">
     104      <SubType>UserControl</SubType>
     105    </Compile>
     106    <Compile Include="Shared\CompoundControl.Designer.cs">
     107      <DependentUpon>CompoundControl.cs</DependentUpon>
     108    </Compile>
    97109    <Compile Include="Shared\JsonItemBaseControl.cs">
    98110      <SubType>UserControl</SubType>
     
    101113      <DependentUpon>JsonItemBaseControl.cs</DependentUpon>
    102114    </Compile>
     115    <Compile Include="Shared\MatrixJsonItemControl.cs">
     116      <SubType>UserControl</SubType>
     117    </Compile>
     118    <Compile Include="Shared\MatrixJsonItemControl.Designer.cs">
     119      <DependentUpon>MatrixJsonItemControl.cs</DependentUpon>
     120    </Compile>
    103121    <Compile Include="Shared\NumericRangeControl.cs">
    104122      <SubType>UserControl</SubType>
     
    108126    </Compile>
    109127    <Compile Include="ViewModels\ArrayValueVM.cs" />
     128    <Compile Include="ViewModels\ConcreteRestrictedJsonItemVM.cs" />
    110129    <Compile Include="ViewModels\DoubleVMs.cs" />
    111130    <Compile Include="ViewModels\IntVMs.cs" />
     
    132151    </Compile>
    133152    <Compile Include="FileManager.cs" />
    134     <Compile Include="Views\JsonItemConcreteItemArrayControl.cs">
    135       <SubType>UserControl</SubType>
    136     </Compile>
    137     <Compile Include="Views\JsonItemConcreteItemArrayControl.Designer.cs">
    138       <DependentUpon>JsonItemConcreteItemArrayControl.cs</DependentUpon>
    139     </Compile>
    140     <Compile Include="Views\JsonItemMultiValueControl.cs">
    141       <SubType>UserControl</SubType>
    142     </Compile>
    143     <Compile Include="Views\JsonItemMultiValueControl.Designer.cs">
    144       <DependentUpon>JsonItemMultiValueControl.cs</DependentUpon>
    145     </Compile>
    146     <Compile Include="Views\JsonItemBoolControl.cs">
    147       <SubType>UserControl</SubType>
    148     </Compile>
    149     <Compile Include="Views\JsonItemBoolControl.Designer.cs">
    150       <DependentUpon>JsonItemBoolControl.cs</DependentUpon>
    151     </Compile>
    152     <Compile Include="Views\JsonItemRangeControl.cs">
    153       <SubType>UserControl</SubType>
    154     </Compile>
    155     <Compile Include="Views\JsonItemRangeControl.Designer.cs">
    156       <DependentUpon>JsonItemRangeControl.cs</DependentUpon>
    157     </Compile>
    158     <Compile Include="Views\JsonItemValueControl.cs">
    159       <SubType>UserControl</SubType>
    160     </Compile>
    161     <Compile Include="Views\JsonItemValueControl.Designer.cs">
    162       <DependentUpon>JsonItemValueControl.cs</DependentUpon>
    163     </Compile>
    164     <Compile Include="Views\JsonItemValidValuesControl.cs">
    165       <SubType>UserControl</SubType>
    166     </Compile>
    167     <Compile Include="Views\JsonItemValidValuesControl.Designer.cs">
    168       <DependentUpon>JsonItemValidValuesControl.cs</DependentUpon>
    169     </Compile>
    170153    <Compile Include="MenuItems\ImportJsonTemplateMenuItem.cs" />
    171154    <Compile Include="MenuItems\ExportJsonTemplateMenuItem.cs" />
    172155    <Compile Include="Plugin.cs" />
    173156    <Compile Include="Properties\AssemblyInfo.cs" />
    174     <Compile Include="Views\LookupJsonItemControl.cs">
    175       <SubType>UserControl</SubType>
    176     </Compile>
    177     <Compile Include="Views\LookupJsonItemControl.Designer.cs">
    178       <DependentUpon>LookupJsonItemControl.cs</DependentUpon>
    179     </Compile>
    180157    <Compile Include="Views\ValueLookupJsonItemControl.cs">
    181158      <SubType>UserControl</SubType>
     
    232209      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    233210    </EmbeddedResource>
     211    <EmbeddedResource Include="Shared\ArrayJsonItemControl.resx">
     212      <DependentUpon>ArrayJsonItemControl.cs</DependentUpon>
     213    </EmbeddedResource>
     214    <EmbeddedResource Include="Shared\CompoundControl.resx">
     215      <DependentUpon>CompoundControl.cs</DependentUpon>
     216    </EmbeddedResource>
    234217    <EmbeddedResource Include="Shared\JsonItemBaseControl.resx">
    235218      <DependentUpon>JsonItemBaseControl.cs</DependentUpon>
    236219    </EmbeddedResource>
     220    <EmbeddedResource Include="Shared\MatrixJsonItemControl.resx">
     221      <DependentUpon>MatrixJsonItemControl.cs</DependentUpon>
     222    </EmbeddedResource>
    237223    <EmbeddedResource Include="Shared\NumericRangeControl.resx">
    238224      <DependentUpon>NumericRangeControl.cs</DependentUpon>
     
    243229    <EmbeddedResource Include="Views\ExportJsonDialog.resx">
    244230      <DependentUpon>ExportJsonDialog.cs</DependentUpon>
    245     </EmbeddedResource>
    246     <EmbeddedResource Include="Views\JsonItemConcreteItemArrayControl.resx">
    247       <DependentUpon>JsonItemConcreteItemArrayControl.cs</DependentUpon>
    248     </EmbeddedResource>
    249     <EmbeddedResource Include="Views\JsonItemMultiValueControl.resx">
    250       <DependentUpon>JsonItemMultiValueControl.cs</DependentUpon>
    251     </EmbeddedResource>
    252     <EmbeddedResource Include="Views\JsonItemBoolControl.resx">
    253       <DependentUpon>JsonItemBoolControl.cs</DependentUpon>
    254     </EmbeddedResource>
    255     <EmbeddedResource Include="Views\JsonItemRangeControl.resx">
    256       <DependentUpon>JsonItemRangeControl.cs</DependentUpon>
    257     </EmbeddedResource>
    258     <EmbeddedResource Include="Views\JsonItemValueControl.resx">
    259       <DependentUpon>JsonItemValueControl.cs</DependentUpon>
    260     </EmbeddedResource>
    261     <EmbeddedResource Include="Views\JsonItemValidValuesControl.resx">
    262       <DependentUpon>JsonItemValidValuesControl.cs</DependentUpon>
    263     </EmbeddedResource>
    264     <EmbeddedResource Include="Views\LookupJsonItemControl.resx">
    265       <DependentUpon>LookupJsonItemControl.cs</DependentUpon>
    266231    </EmbeddedResource>
    267232    <EmbeddedResource Include="Views\ValueLookupJsonItemControl.resx">
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/ConcreteItemsRestrictor.Designer.cs

    r17519 r17828  
    2525    private void InitializeComponent() {
    2626      this.tableOptions = new System.Windows.Forms.TableLayoutPanel();
     27      this.groupBox1 = new System.Windows.Forms.GroupBox();
     28      this.groupBox1.SuspendLayout();
    2729      this.SuspendLayout();
    2830      //
     
    3638      this.tableOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    3739      this.tableOptions.Dock = System.Windows.Forms.DockStyle.Fill;
    38       this.tableOptions.Location = new System.Drawing.Point(0, 0);
     40      this.tableOptions.Location = new System.Drawing.Point(3, 16);
     41      this.tableOptions.Margin = new System.Windows.Forms.Padding(0);
    3942      this.tableOptions.Name = "tableOptions";
    4043      this.tableOptions.RowCount = 1;
    4144      this.tableOptions.RowStyles.Add(new System.Windows.Forms.RowStyle());
    42       this.tableOptions.Size = new System.Drawing.Size(500, 200);
     45      this.tableOptions.Size = new System.Drawing.Size(494, 181);
    4346      this.tableOptions.TabIndex = 13;
     47      //
     48      // groupBox1
     49      //
     50      this.groupBox1.Controls.Add(this.tableOptions);
     51      this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     52      this.groupBox1.Location = new System.Drawing.Point(0, 0);
     53      this.groupBox1.Margin = new System.Windows.Forms.Padding(0);
     54      this.groupBox1.Name = "groupBox1";
     55      this.groupBox1.Size = new System.Drawing.Size(500, 200);
     56      this.groupBox1.TabIndex = 0;
     57      this.groupBox1.TabStop = false;
     58      this.groupBox1.Text = "Allowed Items";
    4459      //
    4560      // ConcreteItemsRestrictor
     
    4762      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    4863      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    49       this.Controls.Add(this.tableOptions);
     64      this.Controls.Add(this.groupBox1);
    5065      this.Margin = new System.Windows.Forms.Padding(0);
    5166      this.Name = "ConcreteItemsRestrictor";
    5267      this.Size = new System.Drawing.Size(500, 200);
     68      this.groupBox1.ResumeLayout(false);
    5369      this.ResumeLayout(false);
    5470
     
    5874
    5975    private System.Windows.Forms.TableLayoutPanel tableOptions;
     76    private System.Windows.Forms.GroupBox groupBox1;
    6077  }
    6178}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs

    r17473 r17828  
    3030      this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
    3131      this.textBoxDescription = new System.Windows.Forms.TextBox();
    32       this.checkBoxActive = new System.Windows.Forms.CheckBox();
    3332      this.label1 = new System.Windows.Forms.Label();
    3433      this.labelDescription = new System.Windows.Forms.Label();
    35       this.labelEnable = new System.Windows.Forms.Label();
    3634      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    3735      this.tableLayoutPanel1.SuspendLayout();
     
    4846      this.textBoxName.Dock = System.Windows.Forms.DockStyle.Fill;
    4947      this.errorProvider.SetIconAlignment(this.textBoxName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    50       this.textBoxName.Location = new System.Drawing.Point(100, 25);
    51       this.textBoxName.Margin = new System.Windows.Forms.Padding(0);
     48      this.textBoxName.Location = new System.Drawing.Point(100, 2);
     49      this.textBoxName.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0);
    5250      this.textBoxName.Name = "textBoxName";
    5351      this.textBoxName.Size = new System.Drawing.Size(394, 20);
     
    6563      this.tableLayoutPanel1.Name = "tableLayoutPanel1";
    6664      this.tableLayoutPanel1.RowCount = 2;
    67       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F));
     65      this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
    6866      this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
    69       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    70       this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    7167      this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 594);
    7268      this.tableLayoutPanel1.TabIndex = 16;
     
    7773      this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
    7874      this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
    79       this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    80       this.tableLayoutPanel5.Controls.Add(this.textBoxDescription, 1, 2);
    81       this.tableLayoutPanel5.Controls.Add(this.textBoxName, 1, 1);
    82       this.tableLayoutPanel5.Controls.Add(this.checkBoxActive, 1, 0);
    83       this.tableLayoutPanel5.Controls.Add(this.label1, 0, 1);
    84       this.tableLayoutPanel5.Controls.Add(this.labelDescription, 0, 2);
    85       this.tableLayoutPanel5.Controls.Add(this.labelEnable, 0, 0);
     75      this.tableLayoutPanel5.Controls.Add(this.textBoxDescription, 1, 1);
     76      this.tableLayoutPanel5.Controls.Add(this.textBoxName, 1, 0);
     77      this.tableLayoutPanel5.Controls.Add(this.label1, 0, 0);
     78      this.tableLayoutPanel5.Controls.Add(this.labelDescription, 0, 1);
    8679      this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
    8780      this.tableLayoutPanel5.Location = new System.Drawing.Point(0, 0);
    8881      this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0);
    8982      this.tableLayoutPanel5.Name = "tableLayoutPanel5";
    90       this.tableLayoutPanel5.RowCount = 3;
    91       this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
    92       this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
    93       this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
    94       this.tableLayoutPanel5.Size = new System.Drawing.Size(494, 75);
     83      this.tableLayoutPanel5.RowCount = 1;
     84      this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
     85      this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
     86      this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
     87      this.tableLayoutPanel5.Size = new System.Drawing.Size(494, 50);
    9588      this.tableLayoutPanel5.TabIndex = 17;
    9689      //
     
    9891      //
    9992      this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
    100       this.textBoxDescription.Location = new System.Drawing.Point(100, 52);
     93      this.textBoxDescription.Location = new System.Drawing.Point(100, 27);
    10194      this.textBoxDescription.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0);
    10295      this.textBoxDescription.Name = "textBoxDescription";
     
    10497      this.textBoxDescription.TabIndex = 14;
    10598      //
    106       // checkBoxActive
    107       //
    108       this.checkBoxActive.AutoSize = true;
    109       this.checkBoxActive.Dock = System.Windows.Forms.DockStyle.Fill;
    110       this.checkBoxActive.Location = new System.Drawing.Point(100, 0);
    111       this.checkBoxActive.Margin = new System.Windows.Forms.Padding(0);
    112       this.checkBoxActive.Name = "checkBoxActive";
    113       this.checkBoxActive.Size = new System.Drawing.Size(394, 25);
    114       this.checkBoxActive.TabIndex = 2;
    115       this.checkBoxActive.UseVisualStyleBackColor = true;
    116       //
    11799      // label1
    118100      //
    119101      this.label1.AutoSize = true;
    120102      this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
    121       this.label1.Location = new System.Drawing.Point(0, 25);
     103      this.label1.Location = new System.Drawing.Point(0, 0);
    122104      this.label1.Margin = new System.Windows.Forms.Padding(0);
    123105      this.label1.Name = "label1";
     
    131113      this.labelDescription.AutoSize = true;
    132114      this.labelDescription.Dock = System.Windows.Forms.DockStyle.Fill;
    133       this.labelDescription.Location = new System.Drawing.Point(0, 50);
     115      this.labelDescription.Location = new System.Drawing.Point(0, 25);
    134116      this.labelDescription.Margin = new System.Windows.Forms.Padding(0);
    135117      this.labelDescription.Name = "labelDescription";
     
    138120      this.labelDescription.Text = "Description";
    139121      this.labelDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    140       //
    141       // labelEnable
    142       //
    143       this.labelEnable.AutoSize = true;
    144       this.labelEnable.Dock = System.Windows.Forms.DockStyle.Fill;
    145       this.labelEnable.Location = new System.Drawing.Point(0, 0);
    146       this.labelEnable.Margin = new System.Windows.Forms.Padding(0);
    147       this.labelEnable.Name = "labelEnable";
    148       this.labelEnable.Size = new System.Drawing.Size(100, 25);
    149       this.labelEnable.TabIndex = 3;
    150       this.labelEnable.Text = "Enable";
    151       this.labelEnable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
    152122      //
    153123      // JsonItemBaseControl
     
    170140    #endregion
    171141    protected System.Windows.Forms.ErrorProvider errorProvider;
    172     protected System.Windows.Forms.Label labelEnable;
    173     protected System.Windows.Forms.CheckBox checkBoxActive;
    174142    protected System.Windows.Forms.TextBox textBoxName;
    175143    protected System.Windows.Forms.Label label1;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs

    r17471 r17828  
    2626      InitializeComponent();
    2727      VM = vm;
    28       control.Margin = new Padding() { All = 0 };
    29       tableLayoutPanel1.Controls.Add(control, 0, 1);
    30       control.Dock = DockStyle.Fill;
     28      if(control != null) {
     29        control.Margin = new Padding() { All = 0 };
     30        tableLayoutPanel1.Controls.Add(control, 0, 1);
     31        control.Dock = DockStyle.Fill;
     32      }
    3133      Init();
    3234    }
    3335
    3436    private void Init() {
    35       checkBoxActive.DataBindings.Add("Checked", VM, nameof(IJsonItemVM.Selected),
    36         false, DataSourceUpdateMode.OnPropertyChanged);
    3737      textBoxName.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Name));
    3838      textBoxDescription.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Description));
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.Designer.cs

    r17471 r17828  
    2626      this.components = new System.ComponentModel.Container();
    2727      this.groupBox2 = new System.Windows.Forms.GroupBox();
    28       this.checkBoxTo = new System.Windows.Forms.CheckBox();
     28      this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
    2929      this.textBoxTo = new System.Windows.Forms.TextBox();
    30       this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    3130      this.textBoxFrom = new System.Windows.Forms.TextBox();
    3231      this.checkBoxFrom = new System.Windows.Forms.CheckBox();
    33       this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
     32      this.checkBoxTo = new System.Windows.Forms.CheckBox();
     33      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
     34      this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
    3435      this.groupBox2.SuspendLayout();
     36      this.tableLayoutPanel2.SuspendLayout();
    3537      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    36       this.tableLayoutPanel2.SuspendLayout();
     38      this.tableLayoutPanel1.SuspendLayout();
    3739      this.SuspendLayout();
    3840      //
     
    4951      this.groupBox2.Text = "Range";
    5052      //
    51       // checkBoxTo
     53      // tableLayoutPanel2
    5254      //
    53       this.checkBoxTo.AutoSize = true;
    54       this.checkBoxTo.Dock = System.Windows.Forms.DockStyle.Fill;
    55       this.checkBoxTo.Location = new System.Drawing.Point(0, 22);
    56       this.checkBoxTo.Margin = new System.Windows.Forms.Padding(0);
    57       this.checkBoxTo.Name = "checkBoxTo";
    58       this.checkBoxTo.Size = new System.Drawing.Size(100, 22);
    59       this.checkBoxTo.TabIndex = 7;
    60       this.checkBoxTo.Text = "To:";
    61       this.checkBoxTo.UseVisualStyleBackColor = true;
     55      this.tableLayoutPanel2.ColumnCount = 2;
     56      this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
     57      this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     58      this.tableLayoutPanel2.Controls.Add(this.textBoxTo, 1, 1);
     59      this.tableLayoutPanel2.Controls.Add(this.textBoxFrom, 1, 0);
     60      this.tableLayoutPanel2.Controls.Add(this.checkBoxFrom, 0, 0);
     61      this.tableLayoutPanel2.Controls.Add(this.checkBoxTo, 0, 1);
     62      this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
     63      this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16);
     64      this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
     65      this.tableLayoutPanel2.Name = "tableLayoutPanel2";
     66      this.tableLayoutPanel2.RowCount = 2;
     67      this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
     68      this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
     69      this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
     70      this.tableLayoutPanel2.Size = new System.Drawing.Size(520, 44);
     71      this.tableLayoutPanel2.TabIndex = 22;
    6272      //
    6373      // textBoxTo
     
    7282      this.textBoxTo.TabIndex = 6;
    7383      this.textBoxTo.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxTo_Validating);
    74       //
    75       // errorProvider
    76       //
    77       this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
    78       this.errorProvider.ContainerControl = this;
    7984      //
    8085      // textBoxFrom
     
    102107      this.checkBoxFrom.UseVisualStyleBackColor = true;
    103108      //
    104       // tableLayoutPanel2
     109      // checkBoxTo
    105110      //
    106       this.tableLayoutPanel2.ColumnCount = 2;
    107       this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
    108       this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
    109       this.tableLayoutPanel2.Controls.Add(this.textBoxTo, 1, 1);
    110       this.tableLayoutPanel2.Controls.Add(this.textBoxFrom, 1, 0);
    111       this.tableLayoutPanel2.Controls.Add(this.checkBoxFrom, 0, 0);
    112       this.tableLayoutPanel2.Controls.Add(this.checkBoxTo, 0, 1);
    113       this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
    114       this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16);
    115       this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
    116       this.tableLayoutPanel2.Name = "tableLayoutPanel2";
    117       this.tableLayoutPanel2.RowCount = 2;
    118       this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    119       this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    120       this.tableLayoutPanel2.Size = new System.Drawing.Size(520, 44);
    121       this.tableLayoutPanel2.TabIndex = 22;
     111      this.checkBoxTo.AutoSize = true;
     112      this.checkBoxTo.Dock = System.Windows.Forms.DockStyle.Fill;
     113      this.checkBoxTo.Location = new System.Drawing.Point(0, 22);
     114      this.checkBoxTo.Margin = new System.Windows.Forms.Padding(0);
     115      this.checkBoxTo.Name = "checkBoxTo";
     116      this.checkBoxTo.Size = new System.Drawing.Size(100, 22);
     117      this.checkBoxTo.TabIndex = 7;
     118      this.checkBoxTo.Text = "To:";
     119      this.checkBoxTo.UseVisualStyleBackColor = true;
     120      //
     121      // errorProvider
     122      //
     123      this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;
     124      this.errorProvider.ContainerControl = this;
     125      //
     126      // tableLayoutPanel1
     127      //
     128      this.tableLayoutPanel1.ColumnCount = 1;
     129      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     130      this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 0);
     131      this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
     132      this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
     133      this.tableLayoutPanel1.Name = "tableLayoutPanel1";
     134      this.tableLayoutPanel1.RowCount = 2;
     135      this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 63F));
     136      this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
     137      this.tableLayoutPanel1.Size = new System.Drawing.Size(526, 63);
     138      this.tableLayoutPanel1.TabIndex = 23;
    122139      //
    123140      // NumericRangeControl
     
    125142      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    126143      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    127       this.Controls.Add(this.groupBox2);
     144      this.Controls.Add(this.tableLayoutPanel1);
    128145      this.Name = "NumericRangeControl";
    129146      this.Size = new System.Drawing.Size(526, 63);
    130147      this.groupBox2.ResumeLayout(false);
    131       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    132148      this.tableLayoutPanel2.ResumeLayout(false);
    133149      this.tableLayoutPanel2.PerformLayout();
     150      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
     151      this.tableLayoutPanel1.ResumeLayout(false);
    134152      this.ResumeLayout(false);
    135153
     
    144162    private System.Windows.Forms.TextBox textBoxFrom;
    145163    private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
     164    private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
    146165  }
    147166}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.cs

    r17444 r17828  
    5151      }
    5252    }
     53
     54    public static UserControl Create(IJsonItemVM vm) {
     55      NumericRangeControl numericRangeControl = new NumericRangeControl();
     56      numericRangeControl.TBMinRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange));
     57      numericRangeControl.TBMaxRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange));
     58      numericRangeControl.EnableMinRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange),
     59        false, DataSourceUpdateMode.OnPropertyChanged);
     60      numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange),
     61        false, DataSourceUpdateMode.OnPropertyChanged);
     62      return numericRangeControl;
     63    }
    5364  }
    5465}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs

    r17519 r17828  
    99namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    1010
    11  
    12 
    13 
    14 
    15   /*
    16   public class StringArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> {
    17     public override Type TargetedJsonItemType => typeof(StringArrayJsonItem);
    18 
    19     protected override int MinTypeValue => int.MinValue;
    20 
    21     protected override int MaxTypeValue => int.MaxValue;
    22 
    23     public override UserControl Control =>
    24       new JsonItemBaseControl(this, new JsonItemIntArrayValueControl(this));
    25 
    26     public override int[] Value {
    27       get => Item.Value;
    28       set {
    29         Item.Value = value;
    30         OnPropertyChange(this, nameof(Value));
    31       }
    32     }
    33   }
    34   */
    35 
    36 
    3711  public abstract class ArrayValueVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>, IArrayJsonItemVM
    3812    where T : IComparable
    3913    where JsonItemType : class, IArrayJsonItem, IIntervalRestrictedJsonItem<T> {
    40    
     14
     15    public override UserControl Control => CompoundControl.Create(base.Control, ArrayJsonItemControl.Create(this));
     16
    4117    public ArrayValueVM() { }
    4218   
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/DoubleVMs.cs

    r17519 r17828  
    88namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    99  public class DoubleRangeVM : RangeVM<double, DoubleRangeJsonItem> {
    10 
    1110    protected override double MinTypeValue => double.MinValue;
    12 
    1311    protected override double MaxTypeValue => double.MaxValue;
    14 
    15     public override UserControl Control =>
    16       new JsonItemRangeControl(this);
    1712  }
    1813
    1914  public class DoubleArrayValueVM : ArrayValueVM<double, DoubleArrayJsonItem> {
    20 
    2115    protected override double MinTypeValue => double.MinValue;
    22 
    2316    protected override double MaxTypeValue => double.MaxValue;
    24 
    25     public override UserControl Control =>
    26       new JsonItemDoubleArrayValueControl(this);
    27 
    2817    public override double[] Value {
    2918      get => Item.Value;
     
    3625
    3726  public class DoubleMatrixValueVM : MatrixValueVM<double, DoubleMatrixJsonItem> {
    38     public override UserControl Control =>
    39       new JsonItemDoubleMatrixValueControl(this);
    40 
    4127    public override double[][] Value {
    4228      get => Item.Value;
     
    4632      }
    4733    }
    48 
    4934    protected override double MinTypeValue => double.MinValue;
    50 
    5135    protected override double MaxTypeValue => double.MaxValue;
    5236  }
    5337
    5438  public class DoubleValueVM : SingleValueVM<double, DoubleJsonItem> {
    55 
    5639    protected override double MinTypeValue => double.MinValue;
    5740    protected override double MaxTypeValue => double.MaxValue;
    58 
    59     public override UserControl Control =>
    60        new JsonItemDoubleValueControl(this);
    6141  }
    6242}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/IntVMs.cs

    r17519 r17828  
    88namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    99  public class IntArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> {
    10 
    1110    protected override int MinTypeValue => int.MinValue;
    12 
    1311    protected override int MaxTypeValue => int.MaxValue;
    14 
    15     public override UserControl Control =>
    16       new JsonItemBaseControl(this, new JsonItemIntArrayValueControl(this));
    1712
    1813    public override int[] Value {
     
    2621
    2722  public class IntRangeVM : RangeVM<int, IntRangeJsonItem> {
    28 
    2923    protected override int MinTypeValue => int.MinValue;
    30 
    3124    protected override int MaxTypeValue => int.MaxValue;
    32 
    33     public override UserControl Control =>
    34       new JsonItemRangeControl(this);
    3525  }
    3626
    3727  public class IntValueVM : SingleValueVM<int, IntJsonItem> {
    38 
    3928    protected override int MinTypeValue => int.MinValue;
    4029    protected override int MaxTypeValue => int.MaxValue;
    41 
    42     public override UserControl Control =>
    43       new JsonItemIntValueControl(this);
    4430  }
    4531
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs

    r17519 r17828  
    99
    1010namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    11   public abstract class JsonItemVMBase<JsonItemType> : IJsonItemVM<JsonItemType> //TODO: RENAME, oder vlt JsonItems direkt als VM?
     11  public abstract class JsonItemVMBase<JsonItemType> : IJsonItemVM<JsonItemType>
    1212    where JsonItemType : class, IJsonItem
    1313  {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/LookupJsonItemVM.cs

    r17519 r17828  
    88namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    99  public class LookupJsonItemVM : JsonItemVMBase<LookupJsonItem>, ILookupJsonItemVM {
    10 
    11     public override UserControl Control => new LookupJsonItemControl(this);
    12 
     10    public override UserControl Control => null;
    1311    public string ActualName {
    1412      get => Item.ActualName;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/MatrixValueVM.cs

    r17519 r17828  
    1313    where T : IComparable
    1414    where JsonItemType : class, IMatrixJsonItem, IIntervalRestrictedJsonItem<T> {
     15
     16    public override UserControl Control => CompoundControl.Create(base.Control, MatrixJsonItemControl.Create(this));
     17
    1518    public abstract T[][] Value { get; set; }
    1619    public bool RowsResizable {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangedValueBaseVM.cs

    r17473 r17828  
    44using System.Text;
    55using System.Threading.Tasks;
     6using System.Windows.Forms;
    67
    78namespace HeuristicLab.JsonInterface.OptimizerIntegration {
     
    1112    where JsonItemType : class, IIntervalRestrictedJsonItem<T>
    1213  {
     14    public override UserControl Control => NumericRangeControl.Create(this);
     15
    1316    public T MinRange {
    1417      get => Item.Minimum;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs

    r17519 r17828  
    1919    }
    2020   
    21     public override UserControl Control =>
    22        new JsonItemBoolControl(this);
     21    public override UserControl Control => null;
    2322  }
    2423
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs

    r17560 r17828  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading;
    6 using System.Threading.Tasks;
    7 using System.Windows.Forms;
     1using System.Linq;
    82
    93namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    10   public class StringValueVM : JsonItemVMBase<StringJsonItem> {
    11     public override UserControl Control =>
    12        new JsonItemValidValuesControl(this);
    134
    14     public string Value {
    15       get => Item.Value?.ToString();
    16       set {
    17         Item.Value = value;
    18         OnPropertyChange(this, nameof(Value));
    19       }
    20     }
     5  public class StringValueVM : ConcreteRestrictedJsonItemVM<StringJsonItem, string, string> {
     6    protected override string GetDefaultValue() => Range.FirstOrDefault();
    217
    22     public IEnumerable<string> Range {
    23       get => Item.ConcreteRestrictedItems;
    24       set {
    25         Item.ConcreteRestrictedItems = value;
    26         //check if value is still in range
    27         if (!Range.Contains(Value)) {
    28           Value = Range.FirstOrDefault();
    29           if (Range.Count() == 0)
    30             //if no elements exists -> deselect item
    31             base.Selected = false;
    32           OnPropertyChange(this, nameof(Value));
    33         }
    34        
    35         OnPropertyChange(this, nameof(Range));
    36       }
    37     }
     8    protected override bool RangeContainsValue() => Range.Contains(Value);
    389  }
    3910
    40   public class StringArrayVM : JsonItemVMBase<StringArrayJsonItem> {
    41     public override UserControl Control =>
    42        new JsonItemConcreteItemArrayControl(this);
     11  public class StringArrayVM : ConcreteRestrictedJsonItemVM<StringArrayJsonItem, string, string[]> {
     12    protected override string[] GetDefaultValue() => Range.ToArray();
    4313
    44     public string[] Value {
    45       get => Item.Value;
    46       set {
    47         Item.Value = value;
    48         OnPropertyChange(this, nameof(Value));
    49       }
    50     }
    51 
    52     public IEnumerable<string> Range {
    53       get => Item.ConcreteRestrictedItems;
    54       set {
    55         Item.ConcreteRestrictedItems = value;
    56         OnPropertyChange(this, nameof(Range));
    57       }
    58     }
     14    protected override bool RangeContainsValue() => Value.All(x => Range.Any(y => x == y));
    5915  }
    6016}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.Designer.cs

    r17481 r17828  
    249249      this.Name = "ExportJsonDialog";
    250250      this.RightToLeft = System.Windows.Forms.RightToLeft.No;
    251       this.ShowIcon = false;
    252251      this.Text = "Export Json";
    253252      this.groupBoxDetails.ResumeLayout(false);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs

    r17601 r17828  
    4040
    4141        Optimizer = content as IOptimizer;
    42         Root = JsonItemConverter.Extract(Optimizer);
    43         TreeNode parent = new TreeNode(Root.Name);
    44         treeView.AfterCheck += TreeView_AfterCheck;
    45         BuildTreeNode(parent, Root);
    46         treeView.Nodes.Add(parent);
    47         treeView.ExpandAll();
    48         panelParameterDetails.Controls.Clear();
    49         panelResultDetails.Controls.Clear();
    50 
     42        if(Optimizer != null) {
     43          Optimizer = (IOptimizer)Optimizer.Clone(); // clone the optimizer
     44          Root = JsonItemConverter.Extract(Optimizer);
     45          TreeNode parent = new TreeNode(Root.Name);
     46          treeView.AfterCheck += TreeView_AfterCheck;
     47          BuildTreeNode(parent, Root);
     48          treeView.Nodes.Add(parent);
     49          treeView.ExpandAll();
     50          panelParameterDetails.Controls.Clear();
     51          panelResultDetails.Controls.Clear();
     52        }
    5153      }
    5254    }
     
    6264    public ExportJsonDialog() {
    6365      InitializeComponent();
     66      this.Icon = HeuristicLab.Common.Resources.HeuristicLab.Icon;
    6467      InitCache();
    6568    }
    6669
    6770    private void exportButton_Click(object sender, EventArgs e) {
    68       // to set default value for disabled items
    69       JsonItemConverter.Inject(Optimizer, Root);
     71      if (FolderBrowserDialog == null) {
     72        FolderBrowserDialog = new FolderBrowserDialog();
     73        FolderBrowserDialog.Description = "Select .json-Template Directory";
     74      }
    7075
    71       // clear all runs
    72       Optimizer.Runs.Clear();
    73 
    74       var validationResult = Root.GetValidator().Validate();
    75       if (!validationResult.Success) {
    76         IList<Exception> list = new List<Exception>();
    77         //print faultyItems
    78         foreach (var x in validationResult.Errors) {
    79           list.Add(new Exception(x));
    80         }
    81         ErrorHandling.ShowErrorDialog(this, new AggregateException(list));
    82       } else {
    83         if (FolderBrowserDialog == null) {
    84           FolderBrowserDialog = new FolderBrowserDialog();
    85           FolderBrowserDialog.Description = "Select .json-Template Dictionary";
    86         }
    87 
    88         if (FolderBrowserDialog.ShowDialog() == DialogResult.OK) {
    89           JsonTemplateGenerator.GenerateTemplate(FolderBrowserDialog.SelectedPath, textBoxTemplateName.Text, Optimizer, Root);
     76      if (FolderBrowserDialog.ShowDialog() == DialogResult.OK) {
     77        try {
     78          JsonTemplateGenerator.GenerateTemplate(
     79            Path.Combine(FolderBrowserDialog.SelectedPath, textBoxTemplateName.Text),
     80            Optimizer, Root);
    9081          Close();
     82        } catch (Exception ex) {
     83          ErrorHandling.ShowErrorDialog(this, ex);
    9184        }
    9285      }
     
    9891        foreach (var c in item.Children) {
    9992          if (IsDrawableItem(c)) {
     93            TreeNode childNode = new TreeNode(c.Name);
    10094            if (c is IResultJsonItem) {
    101               TreeNode childNode = new TreeNode(c.Name);
    10295              treeViewResults.Nodes.Add(childNode);
    103               RegisterItem(childNode, c, treeViewResults);
    104               if(Node2VM.TryGetValue(childNode, out IJsonItemVM vm))
    105                 vm.Selected = true;
    106              
     96              IJsonItemVM vm = RegisterItem(childNode, c, treeViewResults);
     97              if (vm != null) vm.Selected = true;             
    10798            } else {
    108               TreeNode childNode = new TreeNode(c.Name);
    10999              node.Nodes.Add(childNode);
    110100              BuildTreeNode(childNode, c);
     
    115105    }
    116106
    117     private void RegisterItem(TreeNode node, IJsonItem item, TreeView tv) {
    118       if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) { // TODO: enhance for interfaces?
     107    private IJsonItemVM RegisterItem(TreeNode node, IJsonItem item, TreeView tv) {
     108      if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) {
    119109        IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
    120110
     
    128118        UserControl control = new JsonItemBaseControl(vm, vm.Control);
    129119        Node2Control.Add(node, control);
     120        return vm;
    130121      } else {
    131122        node.ForeColor = Color.LightGray;
    132123        node.NodeFont = new Font(SystemFonts.DialogFont, FontStyle.Italic);
    133124      }
     125      return null;
    134126    }
    135127
     
    142134      }
    143135     
    144       return b || !(item is EmptyJsonItem);
     136      return b || !(item is EmptyJsonItem) || !(item is UnsupportedJsonItem);
    145137    }
    146138   
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.cs

    r17473 r17828  
    1111
    1212namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    13   public partial class ValueLookupJsonItemControl : LookupJsonItemControl {
     13  public partial class ValueLookupJsonItemControl : UserControl {
    1414    private static IDictionary<Type, Type> JI2VM { get; set; }
    1515
    16     public ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) : base(vm) {
     16    public ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) {
    1717      InitializeComponent();
    1818      InitCache();
     
    2222        content.Controls.Clear();
    2323        UserControl control = tmp.Control;
    24         content.Controls.Add(control);
    25         control.Dock = DockStyle.Fill;
    26        
     24        if(control != null) {
     25          content.Controls.Add(control);
     26          control.Dock = DockStyle.Fill;
     27        }
    2728      }
    2829    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs

    r17451 r17828  
    1212
    1313    public override Type ConvertableType => typeof(IAlgorithm);
     14
     15    public override bool CanConvertType(Type t) =>
     16      t.GetInterfaces().Any(x => x == ConvertableType);
    1417
    1518    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BaseConverter.cs

    r17477 r17828  
    1212  {
    1313    public abstract int Priority { get; }
     14
     15    public abstract bool CanConvertType(Type t);
     16
    1417    public abstract Type ConvertableType { get; }
    1518
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BatchRunConverter.cs

    r17540 r17828  
    1010    public override int Priority => 10;
    1111    public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("E85407E0-18EC-4198-8321-9CF030FDF6D7"));
     12
     13    public override bool CanConvertType(Type t) => ConvertableType.IsAssignableFrom(t);
    1214
    1315    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
     
    3133        Maximum = int.MaxValue
    3234      });
    33      
    3435      return batchRunJI;
    3536    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs

    r17485 r17828  
    1111    public override int Priority => 3;
    1212    public override Type ConvertableType => typeof(IConstrainedValueParameter<>);
     13
     14    public override bool CanConvertType(Type t) =>
     15      t.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IConstrainedValueParameter<>));
    1316
    1417    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/EnumTypeConverter.cs

    r17473 r17828  
    1111    public override int Priority => 1;
    1212    public override Type ConvertableType => typeof(EnumValue<>);
     13
     14    public override bool CanConvertType(Type t) =>
     15      typeof(EnumValue<>).IsAssignableFrom(t) ||
     16      (t.IsGenericType && t.GetGenericTypeDefinition() == ConvertableType);
    1317
    1418    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    2529        Value = Enum.GetName(enumType, val),
    2630        ConcreteRestrictedItems = Enum.GetNames(enumType)
    27     };
     31      };
    2832    }
    2933  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ExperimentConverter.cs

    r17540 r17828  
    1111    public override int Priority => 10;
    1212    public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("A8A4536B-54C1-4A17-AB58-A6006F7F394B"));
     13
     14    public override bool CanConvertType(Type t) =>
     15      ConvertableType.IsAssignableFrom(t);
    1316
    1417    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/LookupParameterConverter.cs

    r17471 r17828  
    1010    public override int Priority => 3;
    1111    public override Type ConvertableType => typeof(ILookupParameter);
    12    
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(ILookupParameter));
     15
    1316    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    1417      ((ILookupParameter)item).ActualName = ((ILookupJsonItem)data).ActualName as string;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/MultiCheckedOperatorConverter.cs

    r17484 r17828  
    1010  public class MultiCheckedOperatorConverter : ParameterizedItemConverter {
    1111    public override int Priority => 3;
     12
    1213    public override Type ConvertableType => typeof(ICheckedMultiOperator<>);
    13    
     14
     15    public override bool CanConvertType(Type t) =>
     16      t.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == ConvertableType);
     17
    1418    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    1519      base.Inject(item, data, root);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterizedItemConverter.cs

    r17473 r17828  
    1010    public override int Priority => 2;
    1111    public override Type ConvertableType => typeof(IParameterizedItem);
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(IParameterizedItem));
    1215
    1316    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    3942      return item;
    4043    }
     44
    4145  }
    4246}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs

    r17560 r17828  
    3434    public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C"));
    3535
     36    public override bool CanConvertType(Type t) =>
     37      ConvertableType.IsAssignableFrom(t);
     38
    3639    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    3740
     
    180183        if(it != null) {
    181184          if(it.MoveNext() && it.Current is double) {
    182             CreateMatrix(dict, out IList<string> rowNames, out double[][] mat);
     185            CreateMatrix(dict, out IList<string> columnNames, out double[][] mat);
    183186            return new DoubleMatrixJsonItem() {
    184187              Name = Dataset,
    185188              Value = mat,
    186               RowNames = rowNames,
     189              ColumnNames = columnNames,
    187190              Minimum = double.MinValue,
    188191              Maximum = double.MaxValue
    189192            };
    190193          } else if(it.Current is int) {
    191             CreateMatrix(dict, out IList<string> rowNames, out int[][] mat);
     194            CreateMatrix(dict, out IList<string> columnNames, out int[][] mat);
    192195            return new IntMatrixJsonItem() {
    193196              Name = Dataset,
    194197              Value = mat,
    195               RowNames = rowNames,
     198              ColumnNames = columnNames,
    196199              Minimum = int.MinValue,
    197200              Maximum = int.MaxValue
    198201            };
    199202          } else if (it.Current is bool) {
    200             CreateMatrix(dict, out IList<string> rowNames, out bool[][] mat);
     203            CreateMatrix(dict, out IList<string> columnNames, out bool[][] mat);
    201204            return new BoolMatrixJsonItem() {
    202205              Name = Dataset,
    203206              Value = mat,
    204               RowNames = rowNames
     207              ColumnNames = columnNames
    205208            };
    206209          }
     
    210213    }
    211214   
    212     private void CreateMatrix<T>(Dictionary<string, IList> dict, out IList<string> rowNames, out T[][] matrix) {
     215    private void CreateMatrix<T>(Dictionary<string, IList> dict, out IList<string> columnNames, out T[][] matrix) {
    213216      int cols = dict.Count, rows = 0, c = 0;
    214       rowNames = new List<string>();
     217      columnNames = new List<string>();
    215218      matrix = new T[cols][];
    216219      foreach (var x in dict) {
    217220        rows = Math.Max(rows, x.Value.Count);
    218         rowNames.Add(x.Key);
     221        columnNames.Add(x.Key);
    219222
    220223        matrix[c] = new T[rows];
     224
    221225        int r = 0;
    222 
    223         foreach (var rowValue in x.Value) {
    224           matrix[c][r] = (T)rowValue;
     226        foreach (var callValue in x.Value) {
     227          matrix[c][r] = (T)callValue;
    225228          ++r;
    226229        }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs

    r17473 r17828  
    1212
    1313    public override Type ConvertableType => typeof(IResultParameter);
     14
     15    public override bool CanConvertType(Type t) =>
     16      t.GetInterfaces().Any(x => x == typeof(IResultParameter));
    1417
    1518    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs

    r17483 r17828  
    1212    public override Type ConvertableType => typeof(StringValue);
    1313
     14    public override bool CanConvertType(Type t) =>
     15      ConvertableType.IsAssignableFrom(t);
     16
    1417    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    1518      ((StringValue)item).Value = ((StringJsonItem)data).Value;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs

    r17483 r17828  
    1010    public override int Priority => 4;
    1111    public override Type ConvertableType => typeof(IValueLookupParameter);
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(IValueLookupParameter));
    1215
    1316    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs

    r17519 r17828  
    1010    public override int Priority => 2;
    1111    public override Type ConvertableType => typeof(IValueParameter);
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(IValueParameter));
    1215
    1316    public override void Inject(IItem value, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs

    r17483 r17828  
    1414    public override int Priority => 1;
    1515    public override Type ConvertableType => typeof(IntRange);
     16
     17    public override bool CanConvertType(Type t) =>
     18      ConvertableType.IsAssignableFrom(t);
    1619
    1720    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    3942    public override Type ConvertableType => typeof(DoubleRange);
    4043
     44    public override bool CanConvertType(Type t) =>
     45      ConvertableType.IsAssignableFrom(t);
     46
    4147    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    4248      DoubleRange range = item as DoubleRange;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeArrayConverter.cs

    r17477 r17828  
    1313    public override int Priority => 1;
    1414    public override Type ConvertableType => typeof(IntArray);
     15
     16    public override bool CanConvertType(Type t) =>
     17      ConvertableType.IsAssignableFrom(t);
    1518
    1619    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    3942    public override Type ConvertableType => typeof(DoubleArray);
    4043
     44    public override bool CanConvertType(Type t) =>
     45      ConvertableType.IsAssignableFrom(t);
     46
    4147    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    4248      DoubleArray arr = item as DoubleArray;
     
    6369    public override int Priority => 2;
    6470    public override Type ConvertableType => typeof(PercentArray);
     71
     72    public override bool CanConvertType(Type t) =>
     73      ConvertableType.IsAssignableFrom(t);
    6574
    6675    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    8998    public override Type ConvertableType => typeof(BoolArray);
    9099
     100    public override bool CanConvertType(Type t) =>
     101      ConvertableType.IsAssignableFrom(t);
     102
    91103    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    92104      BoolArray arr = item as BoolArray;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs

    r17483 r17828  
    1212    public override int Priority => 1;
    1313    public override Type ConvertableType => typeof(IntMatrix);
     14
    1415    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    1516      IntMatrix mat = item as IntMatrix;
     
    9293    where T : struct
    9394  {
     95    public override bool CanConvertType(Type t) =>
     96      ConvertableType.IsAssignableFrom(t);
     97
    9498    #region Helper
     99    /// <summary>
     100    /// Copies the data into the matrix object. Uses reflection to set the
     101    /// row and column size of the matrix, because it is not possible to
     102    /// create a new matrix at this point and there exists no public resize method.
     103    /// </summary>
     104    /// <param name="matrix"></param>
     105    /// <param name="data"></param>
    95106    protected void CopyMatrixData(MatrixType matrix, T[][] data) {
    96107      var cols = data.Length;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs

    r17483 r17828  
    1212    public override int Priority => 1;
    1313    public override Type ConvertableType => typeof(IntValue);
     14
     15    public override bool CanConvertType(Type t) =>
     16      ConvertableType.IsAssignableFrom(t);
    1417
    1518    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    3033    public override Type ConvertableType => typeof(DoubleValue);
    3134
     35    public override bool CanConvertType(Type t) =>
     36      ConvertableType.IsAssignableFrom(t);
     37
    3238    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    3339      ((DoubleValue)item).Value = ((DoubleJsonItem)data).Value;
     
    4652    public override int Priority => 2;
    4753    public override Type ConvertableType => typeof(PercentValue);
     54
     55    public override bool CanConvertType(Type t) =>
     56      ConvertableType.IsAssignableFrom(t);
    4857
    4958    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    6473    public override Type ConvertableType => typeof(BoolValue);
    6574
     75    public override bool CanConvertType(Type t) =>
     76      ConvertableType.IsAssignableFrom(t);
     77
    6678    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    6779      ((BoolValue)item).Value = ((BoolJsonItem)data).Value;
     
    7991    public override Type ConvertableType => typeof(DateTimeValue);
    8092
     93    public override bool CanConvertType(Type t) =>
     94      ConvertableType.IsAssignableFrom(t);
     95
    8196    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    8297      ((DateTimeValue)item).Value = ((DateTimeJsonItem)data).Value;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IConcreteRestrictedJsonItem.cs

    r17519 r17828  
    1 using System.Collections.Generic;
     1using System.Collections;
     2using System.Collections.Generic;
    23
    34namespace HeuristicLab.JsonInterface {
    45  public interface IConcreteRestrictedJsonItem<T> : IJsonItem {
    56    /// <summary>
    6     /// The item,
     7    /// array of restricted items
    78    /// </summary>
    89    IEnumerable<T> ConcreteRestrictedItems { get; set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItemConverter.cs

    r17519 r17828  
    2929    /// </summary>
    3030    int Priority { get; }
     31
     32    /// <summary>
     33    /// Checks if the given type can be converted.
     34    /// </summary>
     35    /// <param name="t"></param>
     36    /// <returns></returns>
     37    bool CanConvertType(Type t);
    3138  }
    3239}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs

    r17540 r17828  
    2222
    2323    public Type ConvertableType => throw new NotImplementedException();
     24
     25    public bool CanConvertType(Type t) => throw new NotImplementedException();
    2426    #endregion
    2527
     
    3234      IList<IJsonItemConverter> possibleConverters = new List<IJsonItemConverter>();
    3335     
    34       foreach (var x in Converters)
    35         if (CompareTypes(type, x.Key))
     36      foreach (var x in Converters) {
     37        if (x.Value.CanConvertType(type))
    3638          possibleConverters.Add(x.Value);
     39      }
     40       
    3741
    3842      if(possibleConverters.Count > 0) {
     
    6165      else {
    6266        IJsonItemConverter converter = GetConverter(item.GetType());
    63         if (converter == null) return new UnsupportedJsonItem();
     67        if (converter == null)
     68          return new UnsupportedJsonItem() { Name = $"{item.ItemName} (unsupported)" };
    6469        IJsonItem tmp = converter.Extract(item, root);
    6570        ExtractCache.Add(hash, tmp);
     
    8489      Converters = converters;
    8590    }
    86 
    87     private bool CompareGenericTypes(Type t1, Type t2) =>
    88       (t1.IsGenericType && t1.GetGenericTypeDefinition() == t2) /*||
    89       (t2.IsGenericType && t2.GetGenericTypeDefinition() == t1)*/;
    90 
    91     private bool CompareTypes(Type t1, Type t2) =>
    92       t1 == t2 || /*t1.IsAssignableFrom(t2) ||*/
    93       t1.GetInterfaces().Any(
    94         i => i == t2 || CompareGenericTypes(i, t2)
    95       ) ||
    96       CompareGenericTypes(t1, t2);
    9791  }
    9892}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateGenerator.cs

    r17689 r17828  
    1212  public class JsonTemplateGenerator {
    1313
    14     public static void GenerateTemplate(string path, IOptimizer optimizer) =>
    15       GenerateTemplate(path, optimizer.Name, optimizer);
     14    /// <summary>
     15    /// static Function to generate a template.
     16    /// </summary>
     17    /// <param name="templatePath">the path for the template files</param>
     18    /// <param name="optimizer">the optimizer object to serialize</param>
     19    /// <param name="rootItem">Root JsonItem for serialization, considers only active JsonItems for serialization</param>
     20    public static void GenerateTemplate(string templatePath, IOptimizer optimizer, IJsonItem rootItem) {
     21      // clear all runs
     22      optimizer.Runs.Clear();
    1623
    17     public static void GenerateTemplate(string path, string templateName, IOptimizer optimizer) =>
    18       GenerateTemplate(path, templateName, optimizer, JsonItemConverter.Extract(optimizer));
     24      // validation
     25      ValidationResult validationResult = rootItem.GetValidator().Validate();
     26      if (!validationResult.Success)
     27        throw validationResult.GenerateException();
    1928
    20     public static void GenerateTemplate(string path, string templateName, IOptimizer optimizer, IJsonItem rootItem) {
    2129      #region Init
    2230      JObject template = JObject.Parse(Constants.Template);
     
    2432      JArray resultItems = new JArray();
    2533      IList<IJsonItem> jsonItems = new List<IJsonItem>();
    26       string fullPath = Path.GetFullPath(path);
     34      string templateName = Path.GetFileName(templatePath);
     35      string templateDirectory = Path.GetDirectoryName(templatePath);
     36
    2737      #endregion
    2838
     
    3545      #region Serialize HL File
    3646      ProtoBufSerializer serializer = new ProtoBufSerializer();
    37       string hlFilePath = Path.Combine(fullPath, templateName + ".hl");
     47      string hlFilePath = Path.Combine(templateDirectory, $"{templateName}.hl");
    3848      serializer.Serialize(optimizer, hlFilePath);
    3949      #endregion
     
    5666
    5767      #region Serialize and write to file
    58       File.WriteAllText(fullPath + @"\" + templateName + ".json", SingleLineArrayJsonWriter.Serialize(template));
     68      File.WriteAllText(Path.Combine(templateDirectory, $"{templateName}.json"), SingleLineArrayJsonWriter.Serialize(template));
    5969      #endregion
    6070    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs

    r17560 r17828  
    1 using System.Collections.Generic;
     1using System;
     2using System.Collections.Generic;
    23using System.IO;
    34using System.Linq;
     
    6667      IJsonItem rootItem = Objects.First().Value;
    6768
    68       //TODO validate
     69      // validation
     70      ValidationResult validationResult = rootItem.GetValidator().Validate();
     71      if (!validationResult.Success)
     72        throw validationResult.GenerateException();
    6973
    7074      // inject configuration
     
    105109        if (Objects.TryGetValue(path, out IJsonItem param)) {
    106110          // remove fixed template parameter from config => dont allow to copy them from concrete config
     111          // TODO: shift this into JsonItems?
    107112          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Minimum))?.Remove();
    108113          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Maximum))?.Remove();
    109114          obj.Property(nameof(IConcreteRestrictedJsonItem<string>.ConcreteRestrictedItems))?.Remove();
     115          obj.Property(nameof(IMatrixJsonItem.ColumnsResizable))?.Remove();
     116          obj.Property(nameof(IMatrixJsonItem.RowsResizable))?.Remove();
     117          obj.Property(nameof(IArrayJsonItem.Resizable))?.Remove();
    110118          // merge
    111119          param.SetJObject(obj);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ConcreteRestrictedValueJsonItem.cs

    r17519 r17828  
    1 using System.Collections.Generic;
     1using System.Collections;
     2using System.Collections.Generic;
    23using System.Linq;
    34
    45namespace HeuristicLab.JsonInterface {
     6
    57  public abstract class ConcreteRestrictedValueJsonItem<T> : ValueJsonItem<T>, IConcreteRestrictedJsonItem<T> {
     8
    69    public IEnumerable<T> ConcreteRestrictedItems { get; set; }
    710
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntervalRestrictedValueJsonItem.cs

    r17519 r17828  
    2020      if (minProp != null) Minimum = minProp.ToObject<T>();
    2121
    22 
    2322      var maxProp = jObject[nameof(IIntervalRestrictedJsonItem<T>.Maximum)];
    2423      if (maxProp != null) Maximum = maxProp.ToObject<T>();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItem.cs

    r17519 r17828  
    1 using System.Collections;
     1using System;
     2using System.Collections;
    23using System.Collections.Generic;
    34using System.Linq;
     
    2627    public bool Success { get; }
    2728    public IEnumerable<string> Errors { get; }
     29
     30    public Exception GenerateException() =>
     31      new AggregateException(Errors.Select(x => new ArgumentException(x)));
    2832  }
    2933
     
    7680    }
    7781
    78     // TODO jsonIgnore dataType?
    7982    [JsonIgnore]
    8083    public virtual IEnumerable<IJsonItem> Children { get; protected set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ResultJsonItem.cs

    r17519 r17828  
    22  public class ResultJsonItem : JsonItem, IResultJsonItem {
    33    protected override ValidationResult Validate() => ValidationResult.Successful();
     4
     5    public string Converter { get; set; }
    46  }
    57}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/UnsupportedJsonItem.cs

    r17519 r17828  
    11using System;
    22using System.Collections.Generic;
     3using System.Linq;
    34using Newtonsoft.Json;
    45
    56namespace HeuristicLab.JsonInterface {
    67  public class UnsupportedJsonItem : JsonItem {
     8    /*
    79    public override string Name {
    810      get => throw new NotSupportedException();
     
    1012    }
    1113
    12     public override string Description {
     14    public override string Description { // TODO
    1315      get => throw new NotSupportedException();
    1416      set => throw new NotSupportedException();
     
    1820      get => throw new NotSupportedException();
    1921    }
     22    */
    2023
    2124    [JsonIgnore]
    2225    public override IEnumerable<IJsonItem> Children {
    23       get => throw new NotSupportedException();
     26      get => Enumerable.Empty<IJsonItem>();
    2427      protected set => throw new NotSupportedException();
    2528    }
    26 
     29    /*
    2730    [JsonIgnore]
    2831    public override IJsonItem Parent {
     
    3033      set => throw new NotSupportedException();
    3134    }
    32 
     35    */
    3336    protected override ValidationResult Validate() => ValidationResult.Successful();
    3437  }
  • branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs

    r17601 r17828  
    4848
    4949     
    50       JsonTemplateGenerator.GenerateTemplate(@"C:\Workspace\ConfigStarter\", "Template", alg, root);
     50      //JsonTemplateGenerator.GenerateTemplate(@"C:\Workspace\ConfigStarter\", "Template", alg, root);
    5151     
    5252
Note: See TracChangeset for help on using the changeset viewer.