Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/10 14:36:22 (14 years ago)
Author:
mkommend
Message:
  • refactored ViewHost and various views to use fewer nested controls
  • added UnitTests for ContentViews to ensure proper using of the ContentAttribute
  • fixed some views which could not handle null as Content

(ticket #972)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.cs

    r3904 r4011  
    4242    public OperatorGraphView() {
    4343      InitializeComponent();
    44  
     44
    4545      this.graphVisualizationInfoView.Controller.OnShowContextMenu += new EventHandler<EntityMenuEventArgs>(Controller_OnShowContextMenu);
    4646      this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_SelectionChanged);
     
    5858
    5959    protected override void OnContentChanged() {
    60       bool createdVisualizationInfo = false;
    61       if (this.VisualizationInfo == null) {
    62         this.VisualizationInfo = new OperatorGraphVisualizationInfo(this.Content);
    63         createdVisualizationInfo = true;
    64       }
    65       this.graphVisualizationInfoView.Content = this.VisualizationInfo;
    66       if (createdVisualizationInfo)
    67         this.graphVisualizationInfoView.RelayoutGraph();
     60      if (Content != null) {
     61        bool createdVisualizationInfo = false;
     62        if (this.VisualizationInfo == null) {
     63          this.VisualizationInfo = new OperatorGraphVisualizationInfo(this.Content);
     64          createdVisualizationInfo = true;
     65        }
     66        this.graphVisualizationInfoView.Content = this.VisualizationInfo;
     67        if (createdVisualizationInfo)
     68          this.graphVisualizationInfoView.RelayoutGraph();
     69      } else {
     70        this.graphVisualizationInfoView.Content = null;
     71      }
    6872    }
    6973
     
    188192
    189193    private void initialOperatorToolStripMenuItem_Click(object sender, EventArgs e) {
    190         IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
    191         if (this.VisualizationInfo.InitialShape == shapeInfo)
    192           this.VisualizationInfo.InitialShape = null;
    193         else
    194           this.VisualizationInfo.InitialShape = shapeInfo;
     194      IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
     195      if (this.VisualizationInfo.InitialShape == shapeInfo)
     196        this.VisualizationInfo.InitialShape = null;
     197      else
     198        this.VisualizationInfo.InitialShape = shapeInfo;
    195199    }
    196200
    197201    private void breakPointToolStripMenuItem_Click(object sender, EventArgs e) {
    198         IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
    199         if (shapeInfo != null) {
    200           IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
    201           op.Breakpoint = !op.Breakpoint;
    202         }
     202      IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
     203      if (shapeInfo != null) {
     204        IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
     205        op.Breakpoint = !op.Breakpoint;
     206      }
    203207    }
    204208    #endregion
Note: See TracChangeset for help on using the changeset viewer.