Changeset 2684 for trunk/sources/HeuristicLab.Core/3.3/ItemParameter.cs
- Timestamp:
- 01/26/10 05:14:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/ItemParameter.cs
r2664 r2684 31 31 /// Represents a parameter. 32 32 /// </summary> 33 [Item("Item 33 [Item("ItemParameter", "A parameter which represents an IItem.")] 34 34 [Creatable("Test")] 35 35 public class ItemParameter : Parameter { … … 84 84 85 85 public override IItem GetValue(ExecutionContext context) { 86 return GetValue(context, true); 87 } 88 public override IItem GetValue(ExecutionContext context, bool throwOnError) { 86 89 if (Value != null) return Value; 87 90 ExecutionContext parent = context.Parent; … … 94 97 95 98 if (parameter != null) return parameter.GetValue(context); 96 else return context.Scope.Lookup(ActualName, true).Value; 99 else { 100 Variable variable = context.Scope.Lookup(ActualName, true, throwOnError); 101 return variable == null ? null : variable.Value; 102 } 97 103 } 98 104 … … 126 132 } 127 133 128 [Item(" Parameter<T>", "A generic parameter which represents an instance of type T.")]134 [Item("ItemParameter<T>", "A generic parameter which represents an instance of type T.")] 129 135 [EmptyStorableClass] 130 136 public class ItemParameter<T> : ItemParameter where T : class, IItem { … … 148 154 149 155 public new T GetValue(ExecutionContext context) { 150 return (T)base.GetValue(context); 156 return GetValue(context, true); 157 } 158 public new T GetValue(ExecutionContext context, bool throwOnError) { 159 return (T)base.GetValue(context, throwOnError); 151 160 } 152 161 }
Note: See TracChangeset
for help on using the changeset viewer.