Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2862


Ignore:
Timestamp:
02/24/10 21:58:16 (14 years ago)
Author:
mkommend
Message:

important bugfix to avoid duplicate shapes in the view (ticket #867)

File:
1 edited

Legend:

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

    r2861 r2862  
    8787
    8888      foreach (IShapeInfo shapeInfo in this.VisualizationInfo.ShapeInfos)
    89         this.AddShapeInfo(shapeInfo);
     89        if (!this.shapeInfoShapeMapping.ContainsFirst(shapeInfo))
     90          this.AddShapeInfo(shapeInfo);
    9091
    9192      this.UpdateLayoutRoot();
     
    143144      shape.OnEntityChange += new EventHandler<EntityEventArgs>(shape_OnEntityChange);
    144145      this.shapeInfoShapeMapping.Add(shapeInfo, shape);
     146      this.shapeInfoConnectionsMapping.Add(shapeInfo, shapeInfo.ObservableConnections);
    145147
    146148      foreach (IConnector connector in shape.Connectors)
     
    169171
    170172      this.shapeInfoShapeMapping.RemoveByFirst(shapeInfo);
     173      this.shapeInfoConnectionsMapping.RemoveByFirst(shapeInfo);
    171174
    172175      if (this.graphVisualization.Controller.Model.Shapes.Contains(shape)) {
     
    177180    private void RegisterShapeInfoEvents(IShapeInfo shapeInfo) {
    178181      shapeInfo.Changed += new ChangedEventHandler(shapeInfo_Changed);
    179 
    180       this.shapeInfoConnectionsMapping.Add(shapeInfo, shapeInfo.ObservableConnections);
    181182      shapeInfo.ObservableConnections.ItemsAdded += new CollectionItemsChangedEventHandler<KeyValuePair<string, IShapeInfo>>(Connections_ItemsAdded);
    182183      shapeInfo.ObservableConnections.ItemsRemoved += new CollectionItemsChangedEventHandler<KeyValuePair<string, IShapeInfo>>(Connections_ItemsRemoved);
     
    187188    private void DeregisterShapeInfoEvents(IShapeInfo shapeInfo) {
    188189      shapeInfo.Changed -= new ChangedEventHandler(shapeInfo_Changed);
    189 
    190       this.shapeInfoConnectionsMapping.RemoveByFirst(shapeInfo);
    191190      shapeInfo.ObservableConnections.ItemsAdded -= new CollectionItemsChangedEventHandler<KeyValuePair<string, IShapeInfo>>(Connections_ItemsAdded);
    192191      shapeInfo.ObservableConnections.ItemsRemoved -= new CollectionItemsChangedEventHandler<KeyValuePair<string, IShapeInfo>>(Connections_ItemsRemoved);
Note: See TracChangeset for help on using the changeset viewer.