Changeset 16529 for branches/2520_PersistenceReintegration/HeuristicLab.Operators.Programmable.Views
- Timestamp:
- 01/10/19 15:40:44 (6 years ago)
- Location:
- branches/2520_PersistenceReintegration
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2520_PersistenceReintegration
- Property svn:mergeinfo changed
-
branches/2520_PersistenceReintegration/HeuristicLab.Operators.Programmable.Views/3.3/ProgrammableOperatorView.Designer.cs
r16453 r16529 94 94 // tabPage2 95 95 // 96 this.tabPage2.BackColor = System.Drawing.SystemColors.Window; 96 97 this.tabPage2.Controls.Add(this.splitContainer1); 97 98 this.tabPage2.Location = new System.Drawing.Point(4, 22); … … 101 102 this.tabPage2.TabIndex = 1; 102 103 this.tabPage2.Text = "Code"; 103 this.tabPage2.UseVisualStyleBackColor = true;104 104 // 105 105 // splitContainer1 … … 248 248 // tabPage1 249 249 // 250 this.tabPage1.BackColor = System.Drawing.SystemColors.Window; 250 251 this.tabPage1.Controls.Add(this.parameterCollectionView); 251 252 this.tabPage1.Location = new System.Drawing.Point(4, 22); … … 255 256 this.tabPage1.TabIndex = 0; 256 257 this.tabPage1.Text = "Parameters"; 257 this.tabPage1.UseVisualStyleBackColor = true;258 258 // 259 259 // parameterCollectionView -
branches/2520_PersistenceReintegration/HeuristicLab.Operators.Programmable.Views/3.3/ProgrammableOperatorView.cs
r16453 r16529 83 83 if (ProgrammableOperator == null) { 84 84 codeEditor.UserCode = string.Empty; 85 codeEditor.ClearEditHistory(); 85 86 assembliesTreeView.Nodes.Clear(); 86 87 parameterCollectionView.Content = null; … … 91 92 if (codeEditor.UserCode == string.Empty) 92 93 codeEditor.UserCode = string.Format(" {0}", Environment.NewLine); 94 codeEditor.ClearEditHistory(); 93 95 InitializeAssemblyList(); 94 96 InitializeNamespacesList(); … … 98 100 showCodeButton.Enabled = !string.IsNullOrEmpty(ProgrammableOperator.CompilationUnitCode); 99 101 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"; 111 116 } 112 117 } … … 158 163 } 159 164 InitializeNamespacesList(); 160 codeEditor.Prefix = GetGeneratedPrefix();161 165 } 162 166 private void namespacesTreeView_AfterCheck(object sender, TreeViewEventArgs e) { … … 168 172 ProgrammableOperator.UnselectNamespace(e.Node.FullPath); 169 173 } 170 codeEditor.Prefix = GetGeneratedPrefix();171 174 } 172 175 #endregion … … 190 193 private string GetGeneratedPrefix() { 191 194 StringBuilder prefix = new StringBuilder(); 192 foreach (var ns in ProgrammableOperator.GetSelectedAndValidNamespaces()) {193 prefix.Append("using ").Append(ns).AppendLine(";");194 }195 prefix.AppendLine();196 195 prefix.Append("public class ").Append(ProgrammableOperator.CompiledTypeName).AppendLine(" {"); 197 196 prefix.Append(" ").Append(ProgrammableOperator.Signature).AppendLine(" {"); … … 203 202 try { 204 203 ProgrammableOperator.Compile(); 205 } 206 catch (Exception ex) { 204 } catch (Exception ex) { 207 205 ErrorHandling.ShowErrorDialog(this, ex); 208 206 } 209 OnContentChanged();210 207 this.Enabled = true; 208 UpdateCompilationLabel(); 209 codeEditor.ShowCompileErrors(ProgrammableOperator.CompileErrors); 211 210 } 212 211
Note: See TracChangeset
for help on using the changeset viewer.