Changeset 4838 for trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableSingleSuccessorOperator.cs
- Timestamp:
- 11/18/10 16:47:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableSingleSuccessorOperator.cs
r4828 r4838 9 9 [StorableClass] 10 10 public class ProgrammableSingleSuccessorOperator : ProgrammableOperator { 11 12 public IOperator Successor { 13 get { 14 IParameter parameter; 15 Parameters.TryGetValue("Successor", out parameter); 16 OperatorParameter successorParameter = parameter as OperatorParameter; 17 if (successorParameter == null) 18 return null; 19 return successorParameter.Value; 20 } 21 set { 22 ((OperatorParameter)Parameters["Successor"]).Value = value; 23 } 24 } 11 25 12 26 [StorableConstructor] … … 24 38 } 25 39 26 public override IOperation Apply() { 27 IOperation operation = base.Apply(); 28 if (operation != null) 29 return operation; 30 IParameter parameter; 31 Parameters.TryGetValue("Successor", out parameter); 32 OperatorParameter successorParameter = parameter as OperatorParameter; 33 if (successorParameter != null && successorParameter.Value != null) 34 return ExecutionContext.CreateOperation(successorParameter.Value); 35 else 36 return null; 40 public override string MethodSuffix { 41 get { return "return op.Successor == null ? null : context.CreateOperation(op.Successor);"; } 37 42 } 38 43 }
Note: See TracChangeset
for help on using the changeset viewer.