- Timestamp:
- 02/26/10 16:40:01 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs
r2799 r2877 40 40 namespace HeuristicLab.Operators.Programmable { 41 41 42 public class ProgrammableOperator : Operator { 42 [Item("ProgrammableOperator", "An operator that can be programmed for arbitrary needs.")] 43 [Creatable("Test")] 44 [EmptyStorableClass] 45 public class ProgrammableOperator : SingleSuccessorOperator { 43 46 44 47 #region Fields & Properties … … 98 101 } 99 102 103 public override bool CanChangeDescription { 104 get { 105 return true; 106 } 107 } 108 100 109 #endregion 101 110 … … 153 162 154 163 public ProgrammableOperator() { 155 code = ""; 156 Description = "An operator that can be programmed for arbitrary needs."; 164 code = ""; 157 165 executeMethod = null; 158 166 ProgrammableOperator.StaticInitialize(); … … 347 355 CodeMemberMethod method = new CodeMemberMethod(); 348 356 method.Name = "Execute"; 349 method.ReturnType = new CodeTypeReference(typeof(HeuristicLab.Core.I ExecutionSequence));357 method.ReturnType = new CodeTypeReference(typeof(HeuristicLab.Core.IOperation)); 350 358 method.Attributes = MemberAttributes.Public | MemberAttributes.Static; 351 method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IOperator), "op")); 352 // method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IScope), "scope")); 359 method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IOperator), "op")); 353 360 foreach (var param in Parameters) 354 361 method.Parameters.Add(new CodeParameterDeclarationExpression(param.DataType, param.Name)); … … 366 373 367 374 #region HeuristicLab interfaces 368 369 public override I ExecutionSequenceApply() {375 376 public override IOperation Apply() { 370 377 lock (syncRoot) { 371 378 if (executeMethod == null) { … … 376 383 var parameters = new List<object>() { this }; 377 384 parameters.AddRange(Parameters.Select(p => (object)p.ActualValue)); 378 return (I ExecutionSequence)executeMethod.Invoke(null, parameters.ToArray());385 return (IOperation)executeMethod.Invoke(null, parameters.ToArray()); 379 386 } 380 387 … … 402 409 403 410 #endregion 404 411 405 412 } 406 413 }
Note: See TracChangeset
for help on using the changeset viewer.