Changeset 11721 for trunk/sources
- Timestamp:
- 12/23/14 13:35:06 (10 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs
r11480 r11721 117 117 sortDescendingButton.Enabled = false; 118 118 removeButton.Enabled = false; 119 variableListView. Enabled= false;119 variableListView.LabelEdit = false; 120 120 } else { 121 121 bool enabled = !Locked && !ReadOnly; … … 124 124 sortDescendingButton.Enabled = variableListView.Items.Count > 1; 125 125 removeButton.Enabled = enabled && variableListView.SelectedItems.Count > 0; 126 variableListView.Enabled = enabled;127 126 variableListView.LabelEdit = enabled; 128 127 } -
trunk/sources/HeuristicLab.Scripting/3.3/CSharpScript.cs
r11514 r11721 35 35 #region Constants 36 36 protected const string ExecuteMethodName = "Execute"; 37 protected override string CodeTemplate { 38 get { 39 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) 41 // use 'vars.Contains(string)' to check if a variable exists 42 // use 'vars.Clear()' to remove all variables 43 // use 'foreach (KeyValuePair<string, object> v in vars) { ... }' to iterate over all variables 44 // use 'variables' to work with IEnumerable<T> extension methods on the script's variable store 45 46 using System; 47 using System.Linq; 48 using System.Collections.Generic; 49 using HeuristicLab.Common; 50 using HeuristicLab.Core; 51 using HeuristicLab.Data; 52 53 public class MyScript : HeuristicLab.Scripting.CSharpScriptBase { 54 public override void Main() { 55 // type your code here 56 } 57 58 // implement further classes and methods 59 60 }"; 61 } 62 } 37 protected override string CodeTemplate { get { return ReadCodeTemplate("HeuristicLab.Scripting.CSharpScriptCode.cs"); } } 63 38 #endregion 64 39 -
trunk/sources/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj
r11623 r11721 92 92 <ItemGroup> 93 93 <Compile Include="CSharpScript.cs" /> 94 <EmbeddedResource Include="CSharpScriptCode.cs" /> 94 95 <Compile Include="Variables.cs" /> 95 96 <Compile Include="VariableStore.cs" /> -
trunk/sources/HeuristicLab.Scripting/3.3/Script.cs
r11657 r11721 157 157 if (handler != null) handler(this, EventArgs.Empty); 158 158 } 159 160 #region Helpers 161 protected virtual string ReadCodeTemplate(string templateName) { 162 using (var stream = Assembly.GetAssembly(this.GetType()).GetManifestResourceStream(templateName)) 163 using (var reader = new StreamReader(stream)) { 164 return reader.ReadToEnd(); 165 } 166 } 167 #endregion 159 168 } 160 169 }
Note: See TracChangeset
for help on using the changeset viewer.