Changeset 10566
- Timestamp:
- 03/07/14 16:31:17 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Scripting/3.3
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj
r10506 r10566 85 85 </ItemGroup> 86 86 <ItemGroup> 87 <Compile Include="Variables.cs" /> 87 88 <Compile Include="VariableStore.cs" /> 88 89 <None Include="Plugin.cs.frame" /> -
trunk/sources/HeuristicLab.Scripting/3.3/Script.cs
r10506 r10566 38 38 39 39 namespace HeuristicLab.Scripting { 40 [Item(" Script", "An empty C# script.")]40 [Item("C# Script", "An empty C# script.")] 41 41 [Creatable("Scripts")] 42 42 [StorableClass] -
trunk/sources/HeuristicLab.Scripting/3.3/UserScriptBase.cs
r10512 r10566 52 52 var handler = ConsoleOutputChanged; 53 53 if (handler != null) handler(null, new EventArgs<string>(args)); 54 }55 56 protected class Variables : DynamicObject, IEnumerable<KeyValuePair<string, object>> {57 private readonly VariableStore variableStore;58 59 public ICollection<string> Keys {60 get { return variableStore.Keys; }61 }62 63 public ICollection<object> Values {64 get { return variableStore.Values; }65 }66 67 public Variables(VariableStore variableStore) {68 this.variableStore = variableStore;69 }70 71 public override bool TryGetMember(GetMemberBinder binder, out object result) {72 return variableStore.TryGetValue(binder.Name, out result);73 }74 75 public override bool TrySetMember(SetMemberBinder binder, object value) {76 variableStore[binder.Name] = value;77 return true;78 }79 80 public bool Contains(string variableName) {81 return variableStore.ContainsKey(variableName);82 }83 84 public IEnumerator<KeyValuePair<string, object>> GetEnumerator() {85 return variableStore.GetEnumerator();86 }87 88 IEnumerator IEnumerable.GetEnumerator() {89 return GetEnumerator();90 }91 54 } 92 55
Note: See TracChangeset
for help on using the changeset viewer.