Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/12/10 14:34:33 (15 years ago)
Author:
epitzer
Message:

Correctly update displayed method signature if operator parameters change (#842)

Location:
trunk/sources/HeuristicLab.Operators.Programmable/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs

    r3008 r3014  
    4848    #region Fields & Properties
    4949
    50     public new IObservableKeyedCollection<string, IParameter> Parameters {
     50    public new ParameterCollection Parameters {
    5151      get { return base.Parameters; }
    5252    }
     
    172172      Assemblies = defaultAssemblyDict;
    173173      Plugins = defaultPluginDict;
    174       namespaces = new HashSet<string>(DiscoverNamespaces());     
    175       Parameters.ItemsAdded += (s, a) => OnSignatureChanged(s, a);
    176       Parameters.ItemsRemoved += (s, a) => OnSignatureChanged(s, a);
    177       Parameters.ItemsReplaced += (s, a) => OnSignatureChanged(s, a);
    178       Parameters.CollectionReset += (s, a) => OnSignatureChanged(s, a);
     174      namespaces = new HashSet<string>(DiscoverNamespaces());
     175      RegisterEvents();
     176    }
     177
     178    [StorableHook(HookType.AfterDeserialization)]
     179    private void RegisterEvents() {
     180      Parameters.ItemsAdded += OnSignatureChanged;
     181      Parameters.ItemsRemoved += OnSignatureChanged;
     182      Parameters.ItemsReplaced += OnSignatureChanged;
     183      Parameters.CollectionReset += OnSignatureChanged;
    179184    }
    180185
     
    421426      clone.CompilationUnitCode = CompilationUnitCode;
    422427      clone.CompileErrors = CompileErrors;
     428      clone.RegisterEvents();
    423429      return clone;
    424430    }
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.Designer.cs

    r3008 r3014  
    5555      this.tabControl1 = new System.Windows.Forms.TabControl();
    5656      this.tabPage1 = new System.Windows.Forms.TabPage();
    57       this.parameterCollectionView1 = new HeuristicLab.Core.Views.ParameterCollectionView();
     57      this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();
    5858      tabPage2 = new System.Windows.Forms.TabPage();
    5959      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     
    201201      // tabPage1
    202202      //
    203       this.tabPage1.Controls.Add(this.parameterCollectionView1);
     203      this.tabPage1.Controls.Add(this.parameterCollectionView);
    204204      this.tabPage1.Location = new System.Drawing.Point(4, 22);
    205205      this.tabPage1.Name = "tabPage1";
     
    212212      // parameterCollectionView1
    213213      //
    214       this.parameterCollectionView1.Caption = "ParameterCollection";
    215       this.parameterCollectionView1.Content = null;
    216       this.parameterCollectionView1.Dock = System.Windows.Forms.DockStyle.Fill;
    217       this.parameterCollectionView1.Location = new System.Drawing.Point(3, 3);
    218       this.parameterCollectionView1.Name = "parameterCollectionView1";
    219       this.parameterCollectionView1.Size = new System.Drawing.Size(971, 613);
    220       this.parameterCollectionView1.TabIndex = 0;
     214      this.parameterCollectionView.Caption = "ParameterCollection";
     215      this.parameterCollectionView.Content = null;
     216      this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
     217      this.parameterCollectionView.Location = new System.Drawing.Point(3, 3);
     218      this.parameterCollectionView.Name = "parameterCollectionView1";
     219      this.parameterCollectionView.Size = new System.Drawing.Size(971, 613);
     220      this.parameterCollectionView.TabIndex = 0;
    221221      //
    222222      // ProgrammableOperatorView
     
    251251    private System.Windows.Forms.TabControl tabControl1;
    252252    private System.Windows.Forms.TabPage tabPage1;
    253     private HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView1;
     253    private HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
    254254    private System.Windows.Forms.SplitContainer splitContainer1;
    255255    private HeuristicLab.CodeEditor.CodeEditor codeEditor;
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.cs

    r3008 r3014  
    7878        descriptionTextBox.Enabled = false;
    7979        assembliesTreeView.Nodes.Clear();
    80         parameterCollectionView1.Content = null;
     80        parameterCollectionView.Content = null;
    8181      } else {
    8282        codeEditor.Enabled = true;
     
    101101          ProgrammableOperator.CompilationUnitCode != null &&
    102102          ProgrammableOperator.CompilationUnitCode.Length > 0;
    103         parameterCollectionView1.Content = ProgrammableOperator.Parameters;       
     103        parameterCollectionView.Content = ProgrammableOperator.Parameters;
    104104      }
    105105    }
Note: See TracChangeset for help on using the changeset viewer.