Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11135 for trunk/sources


Ignore:
Timestamp:
07/08/14 14:18:41 (10 years ago)
Author:
pfleck
Message:

#2209

  • Added Indexer to Variables for string based access to variables.
  • Updated CSharpScropt code template
Location:
trunk/sources/HeuristicLab.Scripting/3.3
Files:
2 edited

Legend:

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

    r11058 r11135  
    3838      get {
    3939        return @"// use 'vars' to access variables in the script's variable store (e.g. vars.x = 5)
     40// use 'vars[string]' to access variables via runtime strings (e.g. vars[""x""] = 5)
    4041// use 'vars.Contains(string)' to check if a variable exists
    4142// use 'vars.Clear()' to remove all variables
  • trunk/sources/HeuristicLab.Scripting/3.3/Variables.cs

    r10727 r11135  
    2020    }
    2121
     22    public object this[string key] {
     23      get { return variableStore[key]; }
     24      set { variableStore[key] = value; }
     25    }
     26
    2227    public bool Contains(string variableName) {
    2328      return variableStore.ContainsKey(variableName);
Note: See TracChangeset for help on using the changeset viewer.