Index: stable/HeuristicLab.Scripting/3.3/CSharpScript.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/CSharpScript.cs	(revision 11173)
+++ 	(revision )
@@ -1,166 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Linq;
-using System.Reflection;
-using System.Threading;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Scripting {
-  [Item("C# Script", "An empty C# script.")]
-  [Creatable("Scripts")]
-  [StorableClass]
-  public class CSharpScript : Script, IStorableContent {
-    #region Constants
-    protected const string ExecuteMethodName = "Execute";
-    protected override string CodeTemplate {
-      get {
-        return @"// use 'vars' to access variables in the script's variable store (e.g. vars.x = 5)
-// use 'vars[string]' to access variables via runtime strings (e.g. vars[""x""] = 5)
-// use 'vars.Contains(string)' to check if a variable exists
-// use 'vars.Clear()' to remove all variables
-// use 'foreach (KeyValuePair<string, object> v in vars) { ... }' to iterate over all variables
-
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-public class MyScript : HeuristicLab.Scripting.CSharpScriptBase {
-  public override void Main() {
-    // type your code here
-  }
-
-  // implement further classes and methods
-
-}";
-      }
-    }
-    #endregion
-
-    #region Fields & Properties
-    private CSharpScriptBase compiledScript;
-
-    public string Filename { get; set; }
-
-    [Storable]
-    private VariableStore variableStore;
-    public VariableStore VariableStore {
-      get { return variableStore; }
-    }
-    #endregion
-
-    #region Construction & Initialization
-    [StorableConstructor]
-    protected CSharpScript(bool deserializing) : base(deserializing) { }
-    protected CSharpScript(CSharpScript original, Cloner cloner)
-      : base(original, cloner) {
-      variableStore = cloner.Clone(original.variableStore);
-    }
-    public CSharpScript() {
-      variableStore = new VariableStore();
-      Code = CodeTemplate;
-    }
-    public CSharpScript(string code)
-      : base(code) {
-      variableStore = new VariableStore();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new CSharpScript(this, cloner);
-    }
-    #endregion
-
-    protected virtual void RegisterScriptEvents() {
-      if (compiledScript != null)
-        compiledScript.ConsoleOutputChanged += CompiledScriptOnConsoleOutputChanged;
-    }
-
-    protected virtual void DeregisterScriptEvents() {
-      if (compiledScript != null)
-        compiledScript.ConsoleOutputChanged -= CompiledScriptOnConsoleOutputChanged;
-    }
-
-    #region Compilation
-
-    public override Assembly Compile() {
-      DeregisterScriptEvents();
-      compiledScript = null;
-      var assembly = base.Compile();
-      var types = assembly.GetTypes();
-      compiledScript = (CSharpScriptBase)Activator.CreateInstance(types.Single(x => typeof(CSharpScriptBase).IsAssignableFrom(x)));
-      RegisterScriptEvents();
-      return assembly;
-    }
-    #endregion
-
-    private Thread scriptThread;
-    public virtual void Execute() {
-      if (compiledScript == null) return;
-      scriptThread = new Thread(() => {
-        Exception ex = null;
-        try {
-          OnScriptExecutionStarted();
-          compiledScript.Execute(VariableStore);
-        } catch (ThreadAbortException) {
-          // the execution was cancelled by the user
-        } catch (Exception e) {
-          ex = e;
-        } finally {
-          OnScriptExecutionFinished(ex);
-        }
-      });
-      scriptThread.Start();
-    }
-
-    public virtual void Kill() {
-      if (scriptThread.IsAlive)
-        scriptThread.Abort();
-    }
-
-    protected virtual void CompiledScriptOnConsoleOutputChanged(object sender, EventArgs<string> e) {
-      OnConsoleOutputChanged(e.Value);
-    }
-
-    public event EventHandler ScriptExecutionStarted;
-    protected virtual void OnScriptExecutionStarted() {
-      var handler = ScriptExecutionStarted;
-      if (handler != null) handler(this, EventArgs.Empty);
-    }
-
-    public event EventHandler<EventArgs<Exception>> ScriptExecutionFinished;
-    protected virtual void OnScriptExecutionFinished(Exception e) {
-      var handler = ScriptExecutionFinished;
-      if (handler != null) handler(this, new EventArgs<Exception>(e));
-    }
-
-    public event EventHandler<EventArgs<string>> ConsoleOutputChanged;
-    protected virtual void OnConsoleOutputChanged(string args) {
-      var handler = ConsoleOutputChanged;
-      if (handler != null) handler(this, new EventArgs<string>(args));
-    }
-  }
-}
Index: stable/HeuristicLab.Scripting/3.3/CSharpScriptBase.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/CSharpScriptBase.cs	(revision 11173)
+++ 	(revision )
@@ -1,108 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.IO;
-using System.Text;
-using HeuristicLab.Common;
-
-namespace HeuristicLab.Scripting {
-  public abstract class CSharpScriptBase {
-    protected dynamic vars;
-
-    private readonly EventWriter console;
-    protected EventWriter Console {
-      get { return console; }
-    }
-
-    protected CSharpScriptBase() {
-      console = new EventWriter(this);
-    }
-
-    public abstract void Main();
-
-    internal void Execute(VariableStore variableStore) {
-      vars = new Variables(variableStore);
-      Main();
-    }
-
-    protected internal event EventHandler<EventArgs<string>> ConsoleOutputChanged;
-    private void OnConsoleOutputChanged(string args) {
-      var handler = ConsoleOutputChanged;
-      if (handler != null) handler(null, new EventArgs<string>(args));
-    }
-
-    protected class EventWriter : TextWriter {
-      private readonly CSharpScriptBase script;
-
-      public EventWriter(CSharpScriptBase script) {
-        this.script = script;
-      }
-
-      public override Encoding Encoding {
-        get { return Encoding.UTF8; }
-      }
-
-      #region Write/WriteLine Overrides
-      #region Write
-      public override void Write(bool value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(char value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(char[] buffer) { script.OnConsoleOutputChanged(new string(buffer)); }
-      public override void Write(char[] buffer, int index, int count) { script.OnConsoleOutputChanged(new string(buffer, index, count)); }
-      public override void Write(decimal value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(double value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(float value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(int value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(long value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(object value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(string value) { script.OnConsoleOutputChanged(value); }
-      public override void Write(string format, object arg0) { script.OnConsoleOutputChanged(string.Format(format, arg0)); }
-      public override void Write(string format, object arg0, object arg1) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg0)); }
-      public override void Write(string format, object arg0, object arg1, object arg2) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg1, arg2)); }
-      public override void Write(string format, params object[] arg) { script.OnConsoleOutputChanged(string.Format(format, arg)); }
-      public override void Write(uint value) { script.OnConsoleOutputChanged(value.ToString()); }
-      public override void Write(ulong value) { script.OnConsoleOutputChanged(value.ToString()); }
-      #endregion
-
-      #region WriteLine
-      public override void WriteLine() { script.OnConsoleOutputChanged(Environment.NewLine); }
-      public override void WriteLine(bool value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(char value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(char[] buffer) { script.OnConsoleOutputChanged(new string(buffer) + Environment.NewLine); }
-      public override void WriteLine(char[] buffer, int index, int count) { script.OnConsoleOutputChanged(new string(buffer, index, count) + Environment.NewLine); }
-      public override void WriteLine(decimal value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(double value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(float value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(int value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(long value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(object value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(string value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(string format, object arg0) { script.OnConsoleOutputChanged(string.Format(format, arg0) + Environment.NewLine); }
-      public override void WriteLine(string format, object arg0, object arg1) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg1) + Environment.NewLine); }
-      public override void WriteLine(string format, object arg0, object arg1, object arg2) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg1, arg2) + Environment.NewLine); }
-      public override void WriteLine(string format, params object[] arg) { script.OnConsoleOutputChanged(string.Format(format, arg) + Environment.NewLine); }
-      public override void WriteLine(uint value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      public override void WriteLine(ulong value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
-      #endregion
-      #endregion
-    }
-  }
-}
Index: stable/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj
===================================================================
--- stable/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj	(revision 11173)
+++ stable/HeuristicLab.Scripting/3.3/HeuristicLab.Scripting-3.3.csproj	(revision 11907)
@@ -85,10 +85,16 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="CSharpScript.cs" />
+    <Compile Include="Scripts\CSharp\CSharpScript.cs" />
+    <Compile Include="Scripts\Templates\CSharpScriptTemplate.cs" />
+    <Compile Include="Scripts\Templates\ScriptTemplates.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>ScriptTemplates.resx</DependentUpon>
+    </Compile>
     <Compile Include="Variables.cs" />
     <Compile Include="VariableStore.cs" />
     <None Include="Plugin.cs.frame" />
     <Compile Include="Script.cs" />
-    <Compile Include="CSharpScriptBase.cs" />
+    <Compile Include="Scripts\CSharp\CSharpScriptBase.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -130,4 +136,11 @@
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Scripts\Templates\ScriptTemplates.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>ScriptTemplates.Designer.cs</LastGenOutput>
+      <CustomToolNamespace>HeuristicLab.Scripting</CustomToolNamespace>
+    </EmbeddedResource>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    <PropertyGroup>
Index: stable/HeuristicLab.Scripting/3.3/Script.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/Script.cs	(revision 11173)
+++ stable/HeuristicLab.Scripting/3.3/Script.cs	(revision 11907)
@@ -79,5 +79,5 @@
     public Script()
       : base("Script", "An empty script.") {
-      code = string.Empty;
+      code = CodeTemplate;
     }
     public Script(string code)
@@ -108,18 +108,11 @@
         WarningLevel = 4
       };
+
       parameters.ReferencedAssemblies.AddRange(
         GetAssemblies()
         .Select(a => a.Location)
         .ToArray());
-      var unit = CreateCompilationUnit();
-      var writer = new StringWriter();
-      CodeProvider.GenerateCodeFromCompileUnit(
-        unit,
-        writer,
-        new CodeGeneratorOptions {
-          ElseOnClosing = true,
-          IndentString = "  ",
-        });
-      return CodeProvider.CompileAssemblyFromDom(parameters, unit);
+
+      return CodeProvider.CompileAssemblyFromSource(parameters, code);
     }
 
@@ -134,5 +127,5 @@
             .AppendLine(error.ErrorText);
         }
-        throw new Exception(string.Format("Compilation of \"{0}\" failed:{1}{2}",
+        throw new InvalidOperationException(string.Format("Compilation of \"{0}\" failed:{1}{2}",
           Name, Environment.NewLine, sb.ToString()));
       } else {
@@ -142,15 +135,5 @@
 
     public virtual IEnumerable<Assembly> GetAssemblies() {
-      var assemblies = new List<Assembly>();
-      foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) {
-        try {
-          if (File.Exists(a.Location)) assemblies.Add(a);
-        } catch (NotSupportedException) {
-          // NotSupportedException is thrown while accessing 
-          // the Location property of the anonymously hosted
-          // dynamic methods assembly, which is related to
-          // LINQ queries
-        }
-      }
+      var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList();
       assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality
       return assemblies;
Index: stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs	(revision 11907)
+++ stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScript.cs	(revision 11907)
@@ -0,0 +1,143 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using System.Reflection;
+using System.Threading;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Scripting {
+  [Item("C# Script", "An empty C# script.")]
+  [Creatable("Scripts")]
+  [StorableClass]
+  public class CSharpScript : Script, IStorableContent {
+    #region Constants
+    protected const string ExecuteMethodName = "Execute";
+    protected override string CodeTemplate { get { return ScriptTemplates.CSharpScriptTemplate; } }
+    #endregion
+
+    #region Fields & Properties
+    private CSharpScriptBase compiledScript;
+
+    public string Filename { get; set; }
+
+    [Storable]
+    private VariableStore variableStore;
+    public VariableStore VariableStore {
+      get { return variableStore; }
+    }
+    #endregion
+
+    #region Construction & Initialization
+    [StorableConstructor]
+    protected CSharpScript(bool deserializing) : base(deserializing) { }
+    protected CSharpScript(CSharpScript original, Cloner cloner)
+      : base(original, cloner) {
+      variableStore = cloner.Clone(original.variableStore);
+    }
+    public CSharpScript() {
+      variableStore = new VariableStore();
+      Code = CodeTemplate;
+    }
+    public CSharpScript(string code)
+      : base(code) {
+      variableStore = new VariableStore();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new CSharpScript(this, cloner);
+    }
+    #endregion
+
+    protected virtual void RegisterScriptEvents() {
+      if (compiledScript != null)
+        compiledScript.ConsoleOutputChanged += CompiledScriptOnConsoleOutputChanged;
+    }
+
+    protected virtual void DeregisterScriptEvents() {
+      if (compiledScript != null)
+        compiledScript.ConsoleOutputChanged -= CompiledScriptOnConsoleOutputChanged;
+    }
+
+    #region Compilation
+
+    public override Assembly Compile() {
+      DeregisterScriptEvents();
+      compiledScript = null;
+      var assembly = base.Compile();
+      var types = assembly.GetTypes();
+      compiledScript = (CSharpScriptBase)Activator.CreateInstance(types.Single(x => typeof(CSharpScriptBase).IsAssignableFrom(x)));
+      RegisterScriptEvents();
+      return assembly;
+    }
+    #endregion
+
+    private Thread scriptThread;
+    public virtual void ExecuteAsync() {
+      if (compiledScript == null) return;
+      scriptThread = new Thread(() => {
+        Exception ex = null;
+        try {
+          OnScriptExecutionStarted();
+          compiledScript.Execute(VariableStore);
+        } catch (ThreadAbortException) {
+          // the execution was cancelled by the user
+        } catch (Exception e) {
+          ex = e;
+        } finally {
+          OnScriptExecutionFinished(ex);
+        }
+      });
+      scriptThread.SetApartmentState(ApartmentState.STA);
+      scriptThread.Start();
+    }
+
+    public virtual void Kill() {
+      if (scriptThread.IsAlive)
+        scriptThread.Abort();
+    }
+
+    protected virtual void CompiledScriptOnConsoleOutputChanged(object sender, EventArgs<string> e) {
+      OnConsoleOutputChanged(e.Value);
+    }
+
+    public event EventHandler ScriptExecutionStarted;
+    protected virtual void OnScriptExecutionStarted() {
+      var handler = ScriptExecutionStarted;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler<EventArgs<Exception>> ScriptExecutionFinished;
+    protected virtual void OnScriptExecutionFinished(Exception e) {
+      var handler = ScriptExecutionFinished;
+      if (handler != null) handler(this, new EventArgs<Exception>(e));
+    }
+
+    public event EventHandler<EventArgs<string>> ConsoleOutputChanged;
+    protected virtual void OnConsoleOutputChanged(string args) {
+      var handler = ConsoleOutputChanged;
+      if (handler != null) handler(this, new EventArgs<string>(args));
+    }
+  }
+}
Index: stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScriptBase.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScriptBase.cs	(revision 11907)
+++ stable/HeuristicLab.Scripting/3.3/Scripts/CSharp/CSharpScriptBase.cs	(revision 11907)
@@ -0,0 +1,109 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.IO;
+using System.Text;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Scripting {
+  public abstract class CSharpScriptBase {
+    protected Variables variables;
+    protected dynamic vars;
+
+    private readonly EventWriter console;
+    protected EventWriter Console {
+      get { return console; }
+    }
+
+    protected CSharpScriptBase() {
+      console = new EventWriter(this);
+    }
+
+    public abstract void Main();
+
+    internal void Execute(VariableStore variableStore) {
+      variables = vars = new Variables(variableStore);
+      Main();
+    }
+
+    protected internal event EventHandler<EventArgs<string>> ConsoleOutputChanged;
+    private void OnConsoleOutputChanged(string args) {
+      var handler = ConsoleOutputChanged;
+      if (handler != null) handler(null, new EventArgs<string>(args));
+    }
+
+    protected class EventWriter : TextWriter {
+      private readonly CSharpScriptBase script;
+
+      public EventWriter(CSharpScriptBase script) {
+        this.script = script;
+      }
+
+      public override Encoding Encoding {
+        get { return Encoding.UTF8; }
+      }
+
+      #region Write/WriteLine Overrides
+      #region Write
+      public override void Write(bool value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(char value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(char[] buffer) { script.OnConsoleOutputChanged(new string(buffer)); }
+      public override void Write(char[] buffer, int index, int count) { script.OnConsoleOutputChanged(new string(buffer, index, count)); }
+      public override void Write(decimal value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(double value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(float value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(int value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(long value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(object value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(string value) { script.OnConsoleOutputChanged(value); }
+      public override void Write(string format, object arg0) { script.OnConsoleOutputChanged(string.Format(format, arg0)); }
+      public override void Write(string format, object arg0, object arg1) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg0)); }
+      public override void Write(string format, object arg0, object arg1, object arg2) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg1, arg2)); }
+      public override void Write(string format, params object[] arg) { script.OnConsoleOutputChanged(string.Format(format, arg)); }
+      public override void Write(uint value) { script.OnConsoleOutputChanged(value.ToString()); }
+      public override void Write(ulong value) { script.OnConsoleOutputChanged(value.ToString()); }
+      #endregion
+
+      #region WriteLine
+      public override void WriteLine() { script.OnConsoleOutputChanged(Environment.NewLine); }
+      public override void WriteLine(bool value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(char value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(char[] buffer) { script.OnConsoleOutputChanged(new string(buffer) + Environment.NewLine); }
+      public override void WriteLine(char[] buffer, int index, int count) { script.OnConsoleOutputChanged(new string(buffer, index, count) + Environment.NewLine); }
+      public override void WriteLine(decimal value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(double value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(float value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(int value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(long value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(object value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(string value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(string format, object arg0) { script.OnConsoleOutputChanged(string.Format(format, arg0) + Environment.NewLine); }
+      public override void WriteLine(string format, object arg0, object arg1) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg1) + Environment.NewLine); }
+      public override void WriteLine(string format, object arg0, object arg1, object arg2) { script.OnConsoleOutputChanged(string.Format(format, arg0, arg1, arg2) + Environment.NewLine); }
+      public override void WriteLine(string format, params object[] arg) { script.OnConsoleOutputChanged(string.Format(format, arg) + Environment.NewLine); }
+      public override void WriteLine(uint value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      public override void WriteLine(ulong value) { script.OnConsoleOutputChanged(value + Environment.NewLine); }
+      #endregion
+      #endregion
+    }
+  }
+}
Index: stable/HeuristicLab.Scripting/3.3/Scripts/Templates/CSharpScriptTemplate.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/Scripts/Templates/CSharpScriptTemplate.cs	(revision 11907)
+++ stable/HeuristicLab.Scripting/3.3/Scripts/Templates/CSharpScriptTemplate.cs	(revision 11907)
@@ -0,0 +1,24 @@
+﻿// use 'vars' to access variables in the script's variable store (e.g. vars.x = 5)
+// use 'vars[string]' to access variables via runtime strings (e.g. vars[""x""] = 5)
+// use 'vars.Contains(string)' to check if a variable exists
+// use 'vars.Clear()' to remove all variables
+// use 'foreach (KeyValuePair<string, object> v in vars) { ... }' to iterate over all variables
+// use 'variables' to work with IEnumerable<T> extension methods on the script's variable store
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+
+using HeuristicLab.Core;
+using HeuristicLab.Common;
+//using HeuristicLab.Collections;
+//using HeuristicLab.Data;
+
+public class MyScript : HeuristicLab.Scripting.CSharpScriptBase {
+  public override void Main() {
+    // type your code here
+  }
+
+  // implement further classes and methods
+
+}
Index: stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.Designer.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.Designer.cs	(revision 11907)
+++ stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.Designer.cs	(revision 11907)
@@ -0,0 +1,81 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.34014
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HeuristicLab.Scripting {
+    using System;
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class ScriptTemplates {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal ScriptTemplates() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeuristicLab.Scripting.Scripts.Templates.ScriptTemplates", typeof(ScriptTemplates).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to // use &apos;vars&apos; to access variables in the script&apos;s variable store (e.g. vars.x = 5)
+        ///// use &apos;vars[string]&apos; to access variables via runtime strings (e.g. vars[&quot;&quot;x&quot;&quot;] = 5)
+        ///// use &apos;vars.Contains(string)&apos; to check if a variable exists
+        ///// use &apos;vars.Clear()&apos; to remove all variables
+        ///// use &apos;foreach (KeyValuePair&lt;string, object&gt; v in vars) { ... }&apos; to iterate over all variables
+        ///// use &apos;variables&apos; to work with IEnumerable&lt;T&gt; extension methods on the script&apos;s variable store
+        ///
+        ///using System;
+        ///using System.Linq;
+        ///us [rest of string was truncated]&quot;;.
+        /// </summary>
+        internal static string CSharpScriptTemplate {
+            get {
+                return ResourceManager.GetString("CSharpScriptTemplate", resourceCulture);
+            }
+        }
+    }
+}
Index: stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.resx
===================================================================
--- stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.resx	(revision 11907)
+++ stable/HeuristicLab.Scripting/3.3/Scripts/Templates/ScriptTemplates.resx	(revision 11907)
@@ -0,0 +1,124 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="CSharpScriptTemplate" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>csharpscripttemplate.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
+  </data>
+</root>
Index: stable/HeuristicLab.Scripting/3.3/VariableStore.cs
===================================================================
--- stable/HeuristicLab.Scripting/3.3/VariableStore.cs	(revision 11173)
+++ stable/HeuristicLab.Scripting/3.3/VariableStore.cs	(revision 11907)
@@ -21,7 +21,9 @@
 
 using System;
+using System.Drawing;
 using System.IO;
 using HeuristicLab.Collections;
 using HeuristicLab.Common;
+using HeuristicLab.Common.Resources;
 using HeuristicLab.Core;
 using HeuristicLab.Persistence.Core;
@@ -32,5 +34,24 @@
   [Item("VariableStore", "Represents a variable store.")]
   [StorableClass]
-  public class VariableStore : ObservableDictionary<string, object>, IContent, IDeepCloneable {
+  public class VariableStore : ObservableDictionary<string, object>, IItem {
+    #region Properties
+    public virtual string ItemName {
+      get { return ItemAttribute.GetName(GetType()); }
+    }
+    public virtual string ItemDescription {
+      get { return ItemAttribute.GetDescription(GetType()); }
+    }
+    public Version ItemVersion {
+      get { return ItemAttribute.GetVersion(GetType()); }
+    }
+    public static Image StaticItemImage {
+      get { return VSImageLibrary.Class; }
+    }
+    public virtual Image ItemImage {
+      get { return ItemAttribute.GetImage(GetType()); }
+    }
+    #endregion
+
+    #region Constructors & Cloning
     [StorableConstructor]
     protected VariableStore(bool deserializing) : base(deserializing) { }
@@ -68,4 +89,24 @@
       }
     }
+    #endregion
+
+    #region Overrides
+    public override string ToString() {
+      return ItemName;
+    }
+    #endregion
+
+    #region Events
+    public event EventHandler ItemImageChanged;
+    protected virtual void OnItemImageChanged() {
+      var handler = ItemImageChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    public event EventHandler ToStringChanged;
+    protected virtual void OnToStringChanged() {
+      var handler = ToStringChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+    #endregion
   }
 }
