Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/10 06:46:30 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • implemented reviewers' comments
Location:
trunk/sources/HeuristicLab.Operators.Views/3.3
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views/3.3/AlgorithmOperatorView.Designer.cs

    r2830 r2917  
    5050      this.operatorGraphTabPage = new System.Windows.Forms.TabPage();
    5151      this.operatorGraphViewHost = new HeuristicLab.Core.Views.ViewHost();
     52      this.breakpointCheckBox = new System.Windows.Forms.CheckBox();
     53      this.breakpointLabel = new System.Windows.Forms.Label();
    5254      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5355      this.tabControl.SuspendLayout();
     
    6466      // descriptionTextBox
    6567      //
    66       this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    67                   | System.Windows.Forms.AnchorStyles.Right)));
    68       this.descriptionTextBox.Size = new System.Drawing.Size(414, 86);
     68      this.descriptionTextBox.Size = new System.Drawing.Size(414, 20);
    6969      //
    7070      // tabControl
     
    7575      this.tabControl.Controls.Add(this.parametersTabPage);
    7676      this.tabControl.Controls.Add(this.operatorGraphTabPage);
    77       this.tabControl.Location = new System.Drawing.Point(0, 118);
     77      this.tabControl.Location = new System.Drawing.Point(0, 72);
    7878      this.tabControl.Name = "tabControl";
    7979      this.tabControl.SelectedIndex = 0;
    80       this.tabControl.Size = new System.Drawing.Size(486, 364);
    81       this.tabControl.TabIndex = 4;
     80      this.tabControl.Size = new System.Drawing.Size(486, 410);
     81      this.tabControl.TabIndex = 6;
    8282      //
    8383      // parametersTabPage
     
    8787      this.parametersTabPage.Name = "parametersTabPage";
    8888      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
    89       this.parametersTabPage.Size = new System.Drawing.Size(478, 338);
     89      this.parametersTabPage.Size = new System.Drawing.Size(478, 384);
    9090      this.parametersTabPage.TabIndex = 0;
    9191      this.parametersTabPage.Text = "Parameters";
     
    101101      this.parameterCollectionView.Location = new System.Drawing.Point(6, 6);
    102102      this.parameterCollectionView.Name = "parameterCollectionView";
    103       this.parameterCollectionView.Size = new System.Drawing.Size(466, 326);
     103      this.parameterCollectionView.Size = new System.Drawing.Size(466, 372);
    104104      this.parameterCollectionView.TabIndex = 0;
    105105      //
     
    110110      this.operatorGraphTabPage.Name = "operatorGraphTabPage";
    111111      this.operatorGraphTabPage.Padding = new System.Windows.Forms.Padding(3);
    112       this.operatorGraphTabPage.Size = new System.Drawing.Size(478, 338);
     112      this.operatorGraphTabPage.Size = new System.Drawing.Size(478, 384);
    113113      this.operatorGraphTabPage.TabIndex = 1;
    114114      this.operatorGraphTabPage.Text = "Operator Graph";
     
    123123      this.operatorGraphViewHost.Location = new System.Drawing.Point(6, 6);
    124124      this.operatorGraphViewHost.Name = "operatorGraphViewHost";
    125       this.operatorGraphViewHost.Size = new System.Drawing.Size(466, 326);
     125      this.operatorGraphViewHost.Size = new System.Drawing.Size(466, 372);
    126126      this.operatorGraphViewHost.TabIndex = 0;
    127127      this.operatorGraphViewHost.ViewType = null;
     128      //
     129      // breakpointCheckBox
     130      //
     131      this.breakpointCheckBox.AutoSize = true;
     132      this.breakpointCheckBox.Location = new System.Drawing.Point(72, 52);
     133      this.breakpointCheckBox.Name = "breakpointCheckBox";
     134      this.breakpointCheckBox.Size = new System.Drawing.Size(15, 14);
     135      this.breakpointCheckBox.TabIndex = 5;
     136      this.breakpointCheckBox.UseVisualStyleBackColor = true;
     137      this.breakpointCheckBox.CheckedChanged += new System.EventHandler(this.breakpointCheckBox_CheckedChanged);
     138      //
     139      // breakpointLabel
     140      //
     141      this.breakpointLabel.AutoSize = true;
     142      this.breakpointLabel.Location = new System.Drawing.Point(3, 52);
     143      this.breakpointLabel.Name = "breakpointLabel";
     144      this.breakpointLabel.Size = new System.Drawing.Size(61, 13);
     145      this.breakpointLabel.TabIndex = 4;
     146      this.breakpointLabel.Text = "&Breakpoint:";
    128147      //
    129148      // AlgorithmOperatorView
     
    131150      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    132151      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     152      this.Controls.Add(this.breakpointCheckBox);
     153      this.Controls.Add(this.breakpointLabel);
    133154      this.Controls.Add(this.tabControl);
    134155      this.Name = "AlgorithmOperatorView";
     
    139160      this.Controls.SetChildIndex(this.nameTextBox, 0);
    140161      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
     162      this.Controls.SetChildIndex(this.breakpointLabel, 0);
     163      this.Controls.SetChildIndex(this.breakpointCheckBox, 0);
    141164      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    142165      this.tabControl.ResumeLayout(false);
     
    155178    protected HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
    156179    protected HeuristicLab.Core.Views.ViewHost operatorGraphViewHost;
     180    protected System.Windows.Forms.CheckBox breakpointCheckBox;
     181    protected System.Windows.Forms.Label breakpointLabel;
    157182  }
    158183}
  • trunk/sources/HeuristicLab.Operators.Views/3.3/AlgorithmOperatorView.cs

    r2834 r2917  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Core.Views;
     
    2829  /// The base class for visual representations of items.
    2930  /// </summary>
     31  [View("AlgorithmOperator View")]
    3032  [Content(typeof(AlgorithmOperator), true)]
    3133  public partial class AlgorithmOperatorView : NamedItemView {
     
    5052    }
    5153
     54    /// <summary>
     55    /// Removes the eventhandlers from the underlying <see cref="IOperatorGraph"/>.
     56    /// </summary>
     57    /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     58    protected override void DeregisterContentEvents() {
     59      Content.BreakpointChanged -= new EventHandler(Content_BreakpointChanged);
     60      base.DeregisterContentEvents();
     61    }
     62
     63    /// <summary>
     64    /// Adds eventhandlers to the underlying <see cref="IOperatorGraph"/>.
     65    /// </summary>
     66    /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     67    protected override void RegisterContentEvents() {
     68      base.RegisterContentEvents();
     69      Content.BreakpointChanged += new EventHandler(Content_BreakpointChanged);
     70    }
     71
    5272    protected override void OnContentChanged() {
    5373      base.OnContentChanged();
    5474      if (Content == null) {
     75        breakpointCheckBox.Checked = false;
     76        breakpointCheckBox.Enabled = false;
    5577        parameterCollectionView.Content = null;
    5678        operatorGraphViewHost.Content = null;
    5779        tabControl.Enabled = false;
    5880      } else {
     81        breakpointCheckBox.Checked = Content.Breakpoint;
     82        breakpointCheckBox.Enabled = true;
    5983        parameterCollectionView.Content = ((IOperator)Content).Parameters;
    6084        operatorGraphViewHost.Content = Content.OperatorGraph;
     
    6286      }
    6387    }
     88
     89    protected void Content_BreakpointChanged(object sender, EventArgs e) {
     90      if (InvokeRequired)
     91        Invoke(new EventHandler(Content_DescriptionChanged), sender, e);
     92      else
     93        breakpointCheckBox.Checked = Content.Breakpoint;
     94    }
     95
     96    protected void breakpointCheckBox_CheckedChanged(object sender, System.EventArgs e) {
     97      if (Content != null) Content.Breakpoint = breakpointCheckBox.Checked;
     98    }
    6499  }
    65100}
  • trunk/sources/HeuristicLab.Operators.Views/3.3/MultipleCallsOperatorView.Designer.cs

    r2790 r2917  
    5050      this.parametersTabPage = new System.Windows.Forms.TabPage();
    5151      this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();
     52      this.breakpointCheckBox = new System.Windows.Forms.CheckBox();
     53      this.breakpointLabel = new System.Windows.Forms.Label();
    5254      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5355      this.tabControl.SuspendLayout();
     
    6466      // descriptionTextBox
    6567      //
    66       this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    67                   | System.Windows.Forms.AnchorStyles.Right)));
    68       this.descriptionTextBox.Size = new System.Drawing.Size(414, 86);
     68      this.descriptionTextBox.Size = new System.Drawing.Size(414, 20);
    6969      //
    7070      // tabControl
     
    7575      this.tabControl.Controls.Add(this.operatorsTabPage);
    7676      this.tabControl.Controls.Add(this.parametersTabPage);
    77       this.tabControl.Location = new System.Drawing.Point(0, 118);
     77      this.tabControl.Location = new System.Drawing.Point(0, 72);
    7878      this.tabControl.Name = "tabControl";
    7979      this.tabControl.SelectedIndex = 0;
    80       this.tabControl.Size = new System.Drawing.Size(486, 364);
    81       this.tabControl.TabIndex = 4;
     80      this.tabControl.Size = new System.Drawing.Size(486, 410);
     81      this.tabControl.TabIndex = 6;
    8282      //
    8383      // operatorsTabPage
     
    8787      this.operatorsTabPage.Name = "operatorsTabPage";
    8888      this.operatorsTabPage.Padding = new System.Windows.Forms.Padding(3);
    89       this.operatorsTabPage.Size = new System.Drawing.Size(478, 338);
     89      this.operatorsTabPage.Size = new System.Drawing.Size(478, 384);
    9090      this.operatorsTabPage.TabIndex = 0;
    9191      this.operatorsTabPage.Text = "Operators";
     
    101101      this.operatorListView.Location = new System.Drawing.Point(6, 6);
    102102      this.operatorListView.Name = "operatorListView";
    103       this.operatorListView.Size = new System.Drawing.Size(466, 326);
     103      this.operatorListView.Size = new System.Drawing.Size(466, 372);
    104104      this.operatorListView.TabIndex = 0;
    105105      //
     
    127127      this.parameterCollectionView.TabIndex = 0;
    128128      //
     129      // breakpointCheckBox
     130      //
     131      this.breakpointCheckBox.AutoSize = true;
     132      this.breakpointCheckBox.Location = new System.Drawing.Point(72, 52);
     133      this.breakpointCheckBox.Name = "breakpointCheckBox";
     134      this.breakpointCheckBox.Size = new System.Drawing.Size(15, 14);
     135      this.breakpointCheckBox.TabIndex = 5;
     136      this.breakpointCheckBox.UseVisualStyleBackColor = true;
     137      this.breakpointCheckBox.CheckedChanged += new System.EventHandler(this.breakpointCheckBox_CheckedChanged);
     138      //
     139      // breakpointLabel
     140      //
     141      this.breakpointLabel.AutoSize = true;
     142      this.breakpointLabel.Location = new System.Drawing.Point(3, 52);
     143      this.breakpointLabel.Name = "breakpointLabel";
     144      this.breakpointLabel.Size = new System.Drawing.Size(61, 13);
     145      this.breakpointLabel.TabIndex = 4;
     146      this.breakpointLabel.Text = "&Breakpoint:";
     147      //
    129148      // MultipleCallsOperatorView
    130149      //
    131150      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    132151      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     152      this.Controls.Add(this.breakpointCheckBox);
     153      this.Controls.Add(this.breakpointLabel);
    133154      this.Controls.Add(this.tabControl);
    134155      this.Name = "MultipleCallsOperatorView";
     
    139160      this.Controls.SetChildIndex(this.nameTextBox, 0);
    140161      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
     162      this.Controls.SetChildIndex(this.breakpointLabel, 0);
     163      this.Controls.SetChildIndex(this.breakpointCheckBox, 0);
    141164      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    142165      this.tabControl.ResumeLayout(false);
     
    153176    protected System.Windows.Forms.TabPage operatorsTabPage;
    154177    protected System.Windows.Forms.TabPage parametersTabPage;
    155     private HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
    156     private HeuristicLab.Core.Views.OperatorListView operatorListView;
     178    protected HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
     179    protected HeuristicLab.Core.Views.OperatorListView operatorListView;
     180    protected System.Windows.Forms.CheckBox breakpointCheckBox;
     181    protected System.Windows.Forms.Label breakpointLabel;
    157182  }
    158183}
  • trunk/sources/HeuristicLab.Operators.Views/3.3/MultipleCallsOperatorView.cs

    r2796 r2917  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Core.Views;
     
    2829  /// The base class for visual representations of items.
    2930  /// </summary>
     31  [View("MultipleCallsOperator View")]
    3032  [Content(typeof(MultipleCallsOperator), true)]
    3133  public partial class MultipleCallsOperatorView : NamedItemView {
     
    5052    }
    5153
     54    /// <summary>
     55    /// Removes the eventhandlers from the underlying <see cref="IOperatorGraph"/>.
     56    /// </summary>
     57    /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     58    protected override void DeregisterContentEvents() {
     59      Content.BreakpointChanged -= new EventHandler(Content_BreakpointChanged);
     60      base.DeregisterContentEvents();
     61    }
     62
     63    /// <summary>
     64    /// Adds eventhandlers to the underlying <see cref="IOperatorGraph"/>.
     65    /// </summary>
     66    /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     67    protected override void RegisterContentEvents() {
     68      base.RegisterContentEvents();
     69      Content.BreakpointChanged += new EventHandler(Content_BreakpointChanged);
     70    }
     71
    5272    protected override void OnContentChanged() {
    5373      base.OnContentChanged();
    5474      if (Content == null) {
     75        breakpointCheckBox.Checked = false;
     76        breakpointCheckBox.Enabled = false;
    5577        operatorListView.Content = null;
    5678        parameterCollectionView.Content = null;
    5779        tabControl.Enabled = false;
    5880      } else {
     81        breakpointCheckBox.Checked = Content.Breakpoint;
     82        breakpointCheckBox.Enabled = true;
    5983        operatorListView.Content = Content.Operators;
    6084        parameterCollectionView.Content = ((IOperator)Content).Parameters;
     
    6286      }
    6387    }
     88
     89    protected void Content_BreakpointChanged(object sender, EventArgs e) {
     90      if (InvokeRequired)
     91        Invoke(new EventHandler(Content_DescriptionChanged), sender, e);
     92      else
     93        breakpointCheckBox.Checked = Content.Breakpoint;
     94    }
     95
     96    protected void breakpointCheckBox_CheckedChanged(object sender, System.EventArgs e) {
     97      if (Content != null) Content.Breakpoint = breakpointCheckBox.Checked;
     98    }
    6499  }
    65100}
  • trunk/sources/HeuristicLab.Operators.Views/3.3/OperatorView.Designer.cs

    r2845 r2917  
    5252      // parameterCollectionView
    5353      //
    54       this.parameterCollectionView.Location = new System.Drawing.Point(0, 139);
    55       this.parameterCollectionView.Size = new System.Drawing.Size(490, 214);
     54      this.parameterCollectionView.Location = new System.Drawing.Point(0, 72);
     55      this.parameterCollectionView.Size = new System.Drawing.Size(490, 281);
    5656      this.parameterCollectionView.TabIndex = 6;
    5757      //
     
    6464      //
    6565      this.breakpointLabel.AutoSize = true;
    66       this.breakpointLabel.Location = new System.Drawing.Point(3, 120);
     66      this.breakpointLabel.Location = new System.Drawing.Point(3, 52);
    6767      this.breakpointLabel.Name = "breakpointLabel";
    6868      this.breakpointLabel.Size = new System.Drawing.Size(61, 13);
     
    7373      //
    7474      this.breakpointCheckBox.AutoSize = true;
    75       this.breakpointCheckBox.Location = new System.Drawing.Point(72, 119);
     75      this.breakpointCheckBox.Location = new System.Drawing.Point(72, 52);
    7676      this.breakpointCheckBox.Name = "breakpointCheckBox";
    7777      this.breakpointCheckBox.Size = new System.Drawing.Size(15, 14);
     
    8484      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    8585      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     86      this.Controls.Add(this.breakpointCheckBox);
    8687      this.Controls.Add(this.breakpointLabel);
    87       this.Controls.Add(this.breakpointCheckBox);
    8888      this.Name = "OperatorView";
     89      this.Controls.SetChildIndex(this.breakpointLabel, 0);
    8990      this.Controls.SetChildIndex(this.breakpointCheckBox, 0);
    90       this.Controls.SetChildIndex(this.breakpointLabel, 0);
    9191      this.Controls.SetChildIndex(this.nameTextBox, 0);
    9292      this.Controls.SetChildIndex(this.nameLabel, 0);
     
    102102    #endregion
    103103
    104     private System.Windows.Forms.Label breakpointLabel;
    105     private System.Windows.Forms.CheckBox breakpointCheckBox;
     104    protected System.Windows.Forms.Label breakpointLabel;
     105    protected System.Windows.Forms.CheckBox breakpointCheckBox;
    106106
    107107  }
  • trunk/sources/HeuristicLab.Operators.Views/3.3/OperatorView.cs

    r2851 r2917  
    2929  /// The base class for visual representations of items.
    3030  /// </summary>
     31  [View("Operator View (Default)")]
    3132  [Content(typeof(Operator), true)]
    3233  [Content(typeof(IOperator), false)]
     
    8182    }
    8283
    83     private void Content_BreakpointChanged(object sender, EventArgs e) {
     84    protected void Content_BreakpointChanged(object sender, EventArgs e) {
    8485      if (InvokeRequired)
    8586        Invoke(new EventHandler(Content_DescriptionChanged), sender, e);
     
    8889    }
    8990
    90     private void breakpointCheckBox_CheckedChanged(object sender, System.EventArgs e) {
     91    protected void breakpointCheckBox_CheckedChanged(object sender, System.EventArgs e) {
    9192      if (Content != null) Content.Breakpoint = breakpointCheckBox.Checked;
    9293    }
  • trunk/sources/HeuristicLab.Operators.Views/3.3/ValuesCollectorView.Designer.cs

    r2790 r2917  
    5050      this.parametersTabPage = new System.Windows.Forms.TabPage();
    5151      this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();
     52      this.breakpointCheckBox = new System.Windows.Forms.CheckBox();
     53      this.breakpointLabel = new System.Windows.Forms.Label();
    5254      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5355      this.tabControl.SuspendLayout();
     
    6466      // descriptionTextBox
    6567      //
    66       this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    67                   | System.Windows.Forms.AnchorStyles.Right)));
    68       this.descriptionTextBox.Size = new System.Drawing.Size(414, 86);
     68      this.descriptionTextBox.Size = new System.Drawing.Size(414, 20);
    6969      //
    7070      // tabControl
     
    7575      this.tabControl.Controls.Add(this.collectedValuesTabPage);
    7676      this.tabControl.Controls.Add(this.parametersTabPage);
    77       this.tabControl.Location = new System.Drawing.Point(0, 118);
     77      this.tabControl.Location = new System.Drawing.Point(0, 72);
    7878      this.tabControl.Name = "tabControl";
    7979      this.tabControl.SelectedIndex = 0;
    80       this.tabControl.Size = new System.Drawing.Size(486, 364);
    81       this.tabControl.TabIndex = 4;
     80      this.tabControl.Size = new System.Drawing.Size(486, 410);
     81      this.tabControl.TabIndex = 6;
    8282      //
    8383      // collectedValuesTabPage
     
    8787      this.collectedValuesTabPage.Name = "collectedValuesTabPage";
    8888      this.collectedValuesTabPage.Padding = new System.Windows.Forms.Padding(3);
    89       this.collectedValuesTabPage.Size = new System.Drawing.Size(478, 338);
     89      this.collectedValuesTabPage.Size = new System.Drawing.Size(478, 384);
    9090      this.collectedValuesTabPage.TabIndex = 0;
    9191      this.collectedValuesTabPage.Text = "Collected Values";
     
    101101      this.collectedValuesView.Location = new System.Drawing.Point(6, 6);
    102102      this.collectedValuesView.Name = "collectedValuesView";
    103       this.collectedValuesView.Size = new System.Drawing.Size(466, 326);
     103      this.collectedValuesView.Size = new System.Drawing.Size(466, 372);
    104104      this.collectedValuesView.TabIndex = 0;
    105105      //
     
    127127      this.parameterCollectionView.TabIndex = 0;
    128128      //
     129      // breakpointCheckBox
     130      //
     131      this.breakpointCheckBox.AutoSize = true;
     132      this.breakpointCheckBox.Location = new System.Drawing.Point(72, 52);
     133      this.breakpointCheckBox.Name = "breakpointCheckBox";
     134      this.breakpointCheckBox.Size = new System.Drawing.Size(15, 14);
     135      this.breakpointCheckBox.TabIndex = 5;
     136      this.breakpointCheckBox.UseVisualStyleBackColor = true;
     137      this.breakpointCheckBox.CheckedChanged += new System.EventHandler(this.breakpointCheckBox_CheckedChanged);
     138      //
     139      // breakpointLabel
     140      //
     141      this.breakpointLabel.AutoSize = true;
     142      this.breakpointLabel.Location = new System.Drawing.Point(3, 52);
     143      this.breakpointLabel.Name = "breakpointLabel";
     144      this.breakpointLabel.Size = new System.Drawing.Size(61, 13);
     145      this.breakpointLabel.TabIndex = 4;
     146      this.breakpointLabel.Text = "&Breakpoint:";
     147      //
    129148      // ValuesCollectorView
    130149      //
    131150      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    132151      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     152      this.Controls.Add(this.breakpointCheckBox);
     153      this.Controls.Add(this.breakpointLabel);
    133154      this.Controls.Add(this.tabControl);
    134155      this.Name = "ValuesCollectorView";
     
    139160      this.Controls.SetChildIndex(this.nameTextBox, 0);
    140161      this.Controls.SetChildIndex(this.descriptionTextBox, 0);
     162      this.Controls.SetChildIndex(this.breakpointLabel, 0);
     163      this.Controls.SetChildIndex(this.breakpointCheckBox, 0);
    141164      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    142165      this.tabControl.ResumeLayout(false);
     
    155178    protected HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
    156179    protected HeuristicLab.Core.Views.ParameterCollectionView collectedValuesView;
     180    protected System.Windows.Forms.CheckBox breakpointCheckBox;
     181    protected System.Windows.Forms.Label breakpointLabel;
    157182
    158183  }
  • trunk/sources/HeuristicLab.Operators.Views/3.3/ValuesCollectorView.cs

    r2796 r2917  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Core.Views;
     
    2829  /// The base class for visual representations of items.
    2930  /// </summary>
     31  [View("ValuesCollector View")]
    3032  [Content(typeof(ValuesCollector), true)]
    3133  public partial class ValuesCollectorView : NamedItemView {
     
    5052    }
    5153
     54    /// <summary>
     55    /// Removes the eventhandlers from the underlying <see cref="IOperatorGraph"/>.
     56    /// </summary>
     57    /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     58    protected override void DeregisterContentEvents() {
     59      Content.BreakpointChanged -= new EventHandler(Content_BreakpointChanged);
     60      base.DeregisterContentEvents();
     61    }
     62
     63    /// <summary>
     64    /// Adds eventhandlers to the underlying <see cref="IOperatorGraph"/>.
     65    /// </summary>
     66    /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     67    protected override void RegisterContentEvents() {
     68      base.RegisterContentEvents();
     69      Content.BreakpointChanged += new EventHandler(Content_BreakpointChanged);
     70    }
     71
    5272    protected override void OnContentChanged() {
    5373      base.OnContentChanged();
    5474      if (Content == null) {
     75        breakpointCheckBox.Checked = false;
     76        breakpointCheckBox.Enabled = false;
    5577        collectedValuesView.Content = null;
    5678        parameterCollectionView.Content = null;
    5779        tabControl.Enabled = false;
    5880      } else {
     81        breakpointCheckBox.Checked = Content.Breakpoint;
     82        breakpointCheckBox.Enabled = true;
    5983        collectedValuesView.Content = Content.CollectedValues;
    6084        parameterCollectionView.Content = ((IOperator)Content).Parameters;
     
    6286      }
    6387    }
     88
     89    protected void Content_BreakpointChanged(object sender, EventArgs e) {
     90      if (InvokeRequired)
     91        Invoke(new EventHandler(Content_DescriptionChanged), sender, e);
     92      else
     93        breakpointCheckBox.Checked = Content.Breakpoint;
     94    }
     95
     96    protected void breakpointCheckBox_CheckedChanged(object sender, System.EventArgs e) {
     97      if (Content != null) Content.Breakpoint = breakpointCheckBox.Checked;
     98    }
    6499  }
    65100}
Note: See TracChangeset for help on using the changeset viewer.