Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10727 for trunk/sources


Ignore:
Timestamp:
04/07/14 10:36:52 (11 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
Files:
4 edited

Legend:

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

    r10642 r10727  
    7676        ReadOnly = true;
    7777        startStopButton.Image = VSImageLibrary.Stop;
     78        toolTip.SetToolTip(startStopButton, "Stop (Shift+F5)");
    7879        infoTabControl.SelectedTab = outputTabPage;
    7980      }
     
    8687        ReadOnly = false;
    8788        startStopButton.Image = VSImageLibrary.Play;
     89        toolTip.SetToolTip(startStopButton, "Run (F5)");
    8890        running = false;
    8991        var ex = e.Value;
     
    156158      switch (keyData) {
    157159        case Keys.F5:
    158           if (Content != null && !Locked) {
     160          if (Content != null && !Locked && !running) {
    159161            if (Compile()) {
    160162              outputTextBox.Clear();
     
    168170          break;
    169171        case Keys.F6:
    170           Compile();
     172          if (!running) Compile();
    171173          break;
    172174      }
  • trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs

    r10577 r10727  
    2121
    2222using System;
    23 using System.Collections;
    2423using System.Collections.Generic;
    2524using System.Drawing;
     
    396395      string toolTipText = string.Join(Environment.NewLine, lines);
    397396      if (!serializable)
    398         toolTipText += Environment.NewLine + "CAUTION: Type is not serializable!";
     397        toolTipText = "Caution: Type is not serializable!" + Environment.NewLine + toolTipText;
    399398      return toolTipText;
    400399    }
  • 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.