Changeset 13873


Ignore:
Timestamp:
06/06/16 12:18:12 (3 years ago)
Author:
jkarder
Message:

#2205: worked on optimization networks

  • improved network visualization
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/Primitives/NodeRectangle.cs

    r13833 r13873  
    239239        port2primitive.Add(port, portRectangle);
    240240        portRectangles.Add(portRectangle);
     241        var parameterizedPort = port as IParameterizedPort;
     242        if (parameterizedPort != null) {
     243          parameterizedPort.Parameters.ItemsAdded += Parameters_ItemsAdded;
     244          parameterizedPort.Parameters.ItemsRemoved += Parameters_ItemsRemoved;
     245        }
    241246      }
    242247    }
     
    246251
    247252      foreach (var port in e.Items) {
     253        var parameterizedPort = port as IParameterizedPort;
     254        if (parameterizedPort != null) {
     255          parameterizedPort.Parameters.ItemsRemoved -= Parameters_ItemsRemoved;
     256          parameterizedPort.Parameters.ItemsAdded -= Parameters_ItemsAdded;
     257        }
    248258        var portRectangle = port2primitive[port];
     259        portRectangles.Remove(portRectangle);
    249260        port2primitive.Remove(port);
    250         portRectangles.Remove(portRectangle);
    251       }
    252     }
     261      }
     262    }
     263
     264    private void Parameters_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IPortParameter> e) { AdjustSize(); }
     265    private void Parameters_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IPortParameter> e) { AdjustSize(); }
    253266    #endregion
    254267
Note: See TracChangeset for help on using the changeset viewer.