Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/07/14 10:36:52 (10 years ago)
Author:
jkarder
Message:

#2136:

  • fixed tool tips
  • added Clear() method to remove all variables present in the VariableStore
  • the script cannot be compiled and started with the shortcuts anymore if it is already running
Location:
trunk/sources/HeuristicLab.Scripting/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Scripting/3.3/Script.cs

    r10577 r10727  
    4545    private const string ExecuteMethodName = "Execute";
    4646    private const string CodeTemplate =
    47 @"// use 'vars' to access variables in the script's variable store
    48 // vars has a Contains(string) method to check if a variable exists and implements IEnumerable
     47@"// use 'vars' to access variables in the script's variable store (e.g. vars.x = 5)
     48// use 'vars.Contains(string)' to check if a variable exists
     49// use 'vars.Clear()' to remove all variables
     50// use 'foreach (KeyValuePair<string, object> v in vars) { ... }' to iterate over all variables
    4951
    5052using System;
  • trunk/sources/HeuristicLab.Scripting/3.3/Variables.cs

    r10566 r10727  
    66  public class Variables : DynamicObject, IEnumerable<KeyValuePair<string, object>> {
    77    private readonly VariableStore variableStore;
    8 
    9     public ICollection<string> Keys {
    10       get { return variableStore.Keys; }
    11     }
    12 
    13     public ICollection<object> Values {
    14       get { return variableStore.Values; }
    15     }
    168
    179    public Variables(VariableStore variableStore) {
     
    3224    }
    3325
     26    public void Clear() {
     27      variableStore.Clear();
     28    }
     29
    3430    public IEnumerator<KeyValuePair<string, object>> GetEnumerator() {
    3531      return variableStore.GetEnumerator();
Note: See TracChangeset for help on using the changeset viewer.