Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/10 00:51:36 (14 years ago)
Author:
swagner
Message:

Fixed exception thrown in OperatorGraph views when removing one of the operator parameters of a MultiOperator (#1004)

File:
1 edited

Legend:

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

    r3514 r3729  
    363363    private void opParam_ValueChanged(object sender, EventArgs e) {
    364364      IValueParameter opParam = (IValueParameter)sender;
    365       IOperator op = this.parameterOperatorMapping[opParam];
    366       IOperatorShapeInfo shapeInfoFrom = this.operatorShapeInfoMapping.GetByFirst(op);
    367       KeyValuePair<IOperatorShapeInfo, string> connectionFrom = new KeyValuePair<IOperatorShapeInfo, string>(shapeInfoFrom, opParam.Name);
    368 
    369       this.connectionInfos.RemoveWhere(c => c.From == shapeInfoFrom && c.ConnectorFrom == opParam.Name);
    370       if (opParam.Value != null) {
    371         if (!this.operatorShapeInfoMapping.ContainsFirst((IOperator)opParam.Value))
    372           this.AddOperator((IOperator)opParam.Value);
    373         IOperatorShapeInfo shapeInfoTo = this.operatorShapeInfoMapping.GetByFirst((IOperator)opParam.Value);
    374         base.AddConnectionInfo(new ConnectionInfo(shapeInfoFrom, opParam.Name, shapeInfoTo, OperatorShapeInfoFactory.PredecessorConnector));
     365      if (this.parameterOperatorMapping.ContainsKey(opParam)) {
     366        IOperator op = this.parameterOperatorMapping[opParam];
     367        IOperatorShapeInfo shapeInfoFrom = this.operatorShapeInfoMapping.GetByFirst(op);
     368        KeyValuePair<IOperatorShapeInfo, string> connectionFrom = new KeyValuePair<IOperatorShapeInfo, string>(shapeInfoFrom, opParam.Name);
     369
     370        this.connectionInfos.RemoveWhere(c => c.From == shapeInfoFrom && c.ConnectorFrom == opParam.Name);
     371        if (opParam.Value != null) {
     372          if (!this.operatorShapeInfoMapping.ContainsFirst((IOperator)opParam.Value))
     373            this.AddOperator((IOperator)opParam.Value);
     374          IOperatorShapeInfo shapeInfoTo = this.operatorShapeInfoMapping.GetByFirst((IOperator)opParam.Value);
     375          base.AddConnectionInfo(new ConnectionInfo(shapeInfoFrom, opParam.Name, shapeInfoTo, OperatorShapeInfoFactory.PredecessorConnector));
     376        }
    375377      }
    376378    }
Note: See TracChangeset for help on using the changeset viewer.