Changeset 10506 for trunk/sources/HeuristicLab.HLScript
- Timestamp:
- 02/25/14 13:55:01 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.HLScript/3.3
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.HLScript/3.3/HeuristicLab.Scripting-3.3.csproj
r10501 r10506 8 8 <OutputType>Library</OutputType> 9 9 <AppDesignerFolder>Properties</AppDesignerFolder> 10 <RootNamespace>HeuristicLab. HLScript</RootNamespace>11 <AssemblyName>HeuristicLab. HLScript-3.3</AssemblyName>10 <RootNamespace>HeuristicLab.Scripting</RootNamespace> 11 <AssemblyName>HeuristicLab.Scripting-3.3</AssemblyName> 12 12 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> -
trunk/sources/HeuristicLab.HLScript/3.3/Plugin.cs.frame
r10332 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using HeuristicLab.PluginInfrastructure; 23 23 24 namespace HeuristicLab. HLScript{25 [Plugin("HeuristicLab. HLScript", "3.3.9.$WCREV$")]26 [PluginFile("HeuristicLab. HLScript-3.3.dll", PluginFileType.Assembly)]24 namespace HeuristicLab.Scripting { 25 [Plugin("HeuristicLab.Scripting", "3.3.9.$WCREV$")] 26 [PluginFile("HeuristicLab.Scripting-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Collections", "3.3")] 28 28 [PluginDependency("HeuristicLab.Common", "3.3")] … … 30 30 [PluginDependency("HeuristicLab.Core", "3.3")] 31 31 [PluginDependency("HeuristicLab.Persistence", "3.3")] 32 public class HeuristicLab HLScriptPlugin : PluginBase {32 public class HeuristicLabScriptingPlugin : PluginBase { 33 33 } 34 34 } -
trunk/sources/HeuristicLab.HLScript/3.3/Properties/AssemblyInfo.cs.frame
r10332 r10506 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 // set of attributes. Change these attribute values to modify the information 28 28 // associated with an assembly. 29 [assembly: AssemblyTitle("HeuristicLab. HLScript")]29 [assembly: AssemblyTitle("HeuristicLab.Scripting")] 30 30 [assembly: AssemblyDescription("")] 31 31 [assembly: AssemblyConfiguration("")] 32 32 [assembly: AssemblyCompany("")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 3HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2014 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] -
trunk/sources/HeuristicLab.HLScript/3.3/Script.cs
r10401 r10506 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.CodeDom; 3 24 using System.CodeDom.Compiler; … … 16 37 using Microsoft.CSharp; 17 38 18 namespace HeuristicLab. HLScript{19 [Item("Script", "A HeuristicLabscript.")]39 namespace HeuristicLab.Scripting { 40 [Item("Script", "An empty C# script.")] 20 41 [Creatable("Scripts")] 21 42 [StorableClass] … … 27 48 28 49 using System; 29 30 namespace UserScripts { 31 public class UserScript : HeuristicLab.HLScript.UserScriptBase { 32 public override void Main() { 33 // type your code here 34 } 35 36 // further classes and methods37 50 using System.Linq; 51 using System.Collections.Generic; 52 using HeuristicLab.Common; 53 using HeuristicLab.Core; 54 using HeuristicLab.Data; 55 56 public class UserScript : HeuristicLab.Scripting.UserScriptBase { 57 public override void Main() { 58 // type your code here 38 59 } 60 61 // further classes and methods 62 39 63 }"; 40 64 #endregion … … 126 150 GenerateExecutable = false, 127 151 GenerateInMemory = true, 128 IncludeDebugInformation = false 152 IncludeDebugInformation = true, 153 WarningLevel = 4 129 154 }; 130 155 parameters.ReferencedAssemblies.AddRange( … … 212 237 if (executeMethod != null) { 213 238 scriptThread = new Thread(() => { 239 Exception ex = null; 214 240 try { 215 241 OnScriptExecutionStarted(); 216 242 executeMethod.Invoke(compiledScript, new[] { VariableStore }); 243 } catch (ThreadAbortException) { 244 // the execution was cancelled by the user 245 } catch (TargetInvocationException e) { 246 ex = e.InnerException; 217 247 } finally { 218 OnScriptExecutionFinished( );248 OnScriptExecutionFinished(ex); 219 249 } 220 250 }); … … 250 280 } 251 281 252 public event EventHandler ScriptExecutionFinished;253 private void OnScriptExecutionFinished( ) {282 public event EventHandler<EventArgs<Exception>> ScriptExecutionFinished; 283 private void OnScriptExecutionFinished(Exception e) { 254 284 var handler = ScriptExecutionFinished; 255 if (handler != null) handler(this, EventArgs.Empty);285 if (handler != null) handler(this, new EventArgs<Exception>(e)); 256 286 } 257 287 -
trunk/sources/HeuristicLab.HLScript/3.3/UserScriptBase.cs
r10401 r10506 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Dynamic; 3 24 using System.IO; 4 25 using System.Text; 5 using System.Threading;6 26 using HeuristicLab.Common; 7 27 8 namespace HeuristicLab. HLScript{28 namespace HeuristicLab.Scripting { 9 29 public abstract class UserScriptBase { 10 30 protected dynamic vars; … … 23 43 private void Execute(VariableStore variableStore) { 24 44 vars = new Variables(variableStore); 25 try { 26 Main(); 27 } catch (ThreadAbortException) { 28 } catch (Exception e) { 29 Console.WriteLine("---"); 30 Console.WriteLine(e); 31 } 45 Main(); 32 46 } 33 47 -
trunk/sources/HeuristicLab.HLScript/3.3/VariableStore.cs
r10332 r10506 1 using HeuristicLab.Collections; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Collections; 2 23 using HeuristicLab.Common; 3 24 using HeuristicLab.Core; 4 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 5 26 6 namespace HeuristicLab. HLScript{27 namespace HeuristicLab.Scripting { 7 28 [Item("VariableStore", "Represents a variable store.")] 8 29 [StorableClass]
Note: See TracChangeset
for help on using the changeset viewer.