Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/10/19 15:40:44 (6 years ago)
Author:
gkronber
Message:

#2520: merged r16491:16528 from trunk to persistence branch

Location:
branches/2520_PersistenceReintegration
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2520_PersistenceReintegration

  • branches/2520_PersistenceReintegration/HeuristicLab.Operators.Programmable.Views/3.3/ProgrammableOperatorView.Designer.cs

    r16453 r16529  
    9494      // tabPage2
    9595      //
     96      this.tabPage2.BackColor = System.Drawing.SystemColors.Window;
    9697      this.tabPage2.Controls.Add(this.splitContainer1);
    9798      this.tabPage2.Location = new System.Drawing.Point(4, 22);
     
    101102      this.tabPage2.TabIndex = 1;
    102103      this.tabPage2.Text = "Code";
    103       this.tabPage2.UseVisualStyleBackColor = true;
    104104      //
    105105      // splitContainer1
     
    248248      // tabPage1
    249249      //
     250      this.tabPage1.BackColor = System.Drawing.SystemColors.Window;
    250251      this.tabPage1.Controls.Add(this.parameterCollectionView);
    251252      this.tabPage1.Location = new System.Drawing.Point(4, 22);
     
    255256      this.tabPage1.TabIndex = 0;
    256257      this.tabPage1.Text = "Parameters";
    257       this.tabPage1.UseVisualStyleBackColor = true;
    258258      //
    259259      // parameterCollectionView
  • branches/2520_PersistenceReintegration/HeuristicLab.Operators.Programmable.Views/3.3/ProgrammableOperatorView.cs

    r16453 r16529  
    8383      if (ProgrammableOperator == null) {
    8484        codeEditor.UserCode = string.Empty;
     85        codeEditor.ClearEditHistory();
    8586        assembliesTreeView.Nodes.Clear();
    8687        parameterCollectionView.Content = null;
     
    9192        if (codeEditor.UserCode == string.Empty)
    9293          codeEditor.UserCode = string.Format("    {0}", Environment.NewLine);
     94        codeEditor.ClearEditHistory();
    9395        InitializeAssemblyList();
    9496        InitializeNamespacesList();
     
    98100        showCodeButton.Enabled = !string.IsNullOrEmpty(ProgrammableOperator.CompilationUnitCode);
    99101        parameterCollectionView.Content = ProgrammableOperator.Parameters;
    100         if (ProgrammableOperator.CompileErrors == null) {
    101           compilationLabel.ForeColor = SystemColors.ControlDarkDark;
    102           compilationLabel.Text = "Not compiled";
    103         } else if (ProgrammableOperator.CompileErrors.HasErrors) {
    104           compilationLabel.ForeColor = Color.DarkRed;
    105           compilationLabel.Text = "Compilation failed";
    106         } else {
    107           compilationLabel.ForeColor = Color.DarkGreen;
    108           compilationLabel.Text = "Compilation successful";
    109         }
    110 
     102      }
     103      UpdateCompilationLabel();
     104    }
     105
     106    private void UpdateCompilationLabel() {
     107      if (ProgrammableOperator == null || ProgrammableOperator.CompileErrors == null) {
     108        compilationLabel.ForeColor = SystemColors.ControlDarkDark;
     109        compilationLabel.Text = "Not compiled";
     110      } else if (ProgrammableOperator.CompileErrors.HasErrors) {
     111        compilationLabel.ForeColor = Color.DarkRed;
     112        compilationLabel.Text = "Compilation failed";
     113      } else {
     114        compilationLabel.ForeColor = Color.DarkGreen;
     115        compilationLabel.Text = "Compilation successful";
    111116      }
    112117    }
     
    158163      }
    159164      InitializeNamespacesList();
    160       codeEditor.Prefix = GetGeneratedPrefix();
    161165    }
    162166    private void namespacesTreeView_AfterCheck(object sender, TreeViewEventArgs e) {
     
    168172        ProgrammableOperator.UnselectNamespace(e.Node.FullPath);
    169173      }
    170       codeEditor.Prefix = GetGeneratedPrefix();
    171174    }
    172175    #endregion
     
    190193    private string GetGeneratedPrefix() {
    191194      StringBuilder prefix = new StringBuilder();
    192       foreach (var ns in ProgrammableOperator.GetSelectedAndValidNamespaces()) {
    193         prefix.Append("using ").Append(ns).AppendLine(";");
    194       }
    195       prefix.AppendLine();
    196195      prefix.Append("public class ").Append(ProgrammableOperator.CompiledTypeName).AppendLine(" {");
    197196      prefix.Append("  ").Append(ProgrammableOperator.Signature).AppendLine(" {");
     
    203202      try {
    204203        ProgrammableOperator.Compile();
    205       }
    206       catch (Exception ex) {
     204      } catch (Exception ex) {
    207205        ErrorHandling.ShowErrorDialog(this, ex);
    208206      }
    209       OnContentChanged();
    210207      this.Enabled = true;
     208      UpdateCompilationLabel();
     209      codeEditor.ShowCompileErrors(ProgrammableOperator.CompileErrors);
    211210    }
    212211
Note: See TracChangeset for help on using the changeset viewer.