- Timestamp:
- 05/10/10 00:51:36 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs
r3566 r3729 225 225 else { 226 226 IValueParameter opParam = (IValueParameter)sender; 227 foreach (TreeNode node in opParamNodeTable[opParam].ToArray()) 228 ClearTreeNode(node); 229 foreach (TreeNode node in opParamNodeTable[opParam]) { 230 node.Text = opParam.Name + ": "; 231 FillTreeNode(node, (IOperator)opParam.Value); 227 if (opParamNodeTable.ContainsKey(opParam)) { 228 foreach (TreeNode node in opParamNodeTable[opParam].ToArray()) 229 ClearTreeNode(node); 230 foreach (TreeNode node in opParamNodeTable[opParam]) { 231 node.Text = opParam.Name + ": "; 232 FillTreeNode(node, (IOperator)opParam.Value); 233 } 232 234 } 233 235 } -
trunk/sources/HeuristicLab.Core/3.3/OperatorGraph.cs
r3407 r3729 142 142 143 143 // remove edges to removed operator 144 var opParams =from o in Operators145 from p in o.Parameters146 where p is IValueParameter147 where typeof(IOperator).IsAssignableFrom(((IValueParameter)p).DataType)148 where (((IValueParameter)p).Value != null) && (((IValueParameter)p).Value == op)149 select (IValueParameter)p;144 IValueParameter[] opParams = (from o in Operators 145 from p in o.Parameters 146 where p is IValueParameter 147 where typeof(IOperator).IsAssignableFrom(((IValueParameter)p).DataType) 148 where (((IValueParameter)p).Value != null) && (((IValueParameter)p).Value == op) 149 select (IValueParameter)p).ToArray(); 150 150 foreach (IValueParameter opParam in opParams) 151 151 opParam.Value = null; -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphVisualizationInfo.cs
r3514 r3729 363 363 private void opParam_ValueChanged(object sender, EventArgs e) { 364 364 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 } 375 377 } 376 378 } -
trunk/sources/HeuristicLab.Operators/3.3/MultiOperator.cs
r3591 r3729 86 86 operatorParameters.Clear(); 87 87 for (int i = 0; i < Operators.Count; i++) { 88 IValueParameter<T> opParam = new ValueParameter<T>(i.ToString(), string.Empty, Operators[i]);88 IValueParameter<T> opParam = new OptionalValueParameter<T>(i.ToString(), string.Empty, Operators[i]); 89 89 opParam.ValueChanged += new EventHandler(opParam_ValueChanged); 90 90 Parameters.Add(opParam); … … 127 127 private void opParam_ValueChanged(object sender, EventArgs e) { 128 128 IValueParameter<T> opParam = (IValueParameter<T>)sender; 129 operators[operatorParameters.IndexOf(opParam)] = opParam.Value; 129 if (opParam.Value == null) 130 operators.RemoveAt(operatorParameters.IndexOf(opParam)); 131 else 132 operators[operatorParameters.IndexOf(opParam)] = opParam.Value; 130 133 } 131 134 #endregion
Note: See TracChangeset
for help on using the changeset viewer.