Index: trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.cs	(revision 11435)
+++ trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.cs	(revision 11436)
@@ -133,4 +133,9 @@
     }
 
+    public bool ReadOnly {
+      get { return Doc.ReadOnly; }
+      set { Doc.ReadOnly = value; }
+    }
+
     #endregion
 
Index: trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 11435)
+++ trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 11436)
@@ -45,4 +45,14 @@
     }
 
+    public override bool ReadOnly {
+      get { return codeEditor.ReadOnly; }
+      set { codeEditor.ReadOnly = value; }
+    }
+
+    public override bool Locked {
+      get { return codeEditor.ReadOnly; }
+      set { codeEditor.ReadOnly = value; }
+    }
+
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
@@ -83,5 +93,5 @@
       base.SetEnabledStateOfControls();
       compileButton.Enabled = Content != null && !Locked && !ReadOnly;
-      codeEditor.Enabled = Content != null && !Locked && !ReadOnly;
+      codeEditor.Enabled = Content != null;
     }
 
Index: trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.Designer.cs	(revision 11435)
+++ trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.Designer.cs	(revision 11436)
@@ -66,5 +66,4 @@
       this.variableListView.LabelEdit = true;
       this.variableListView.Location = new System.Drawing.Point(6, 49);
-      this.variableListView.MultiSelect = false;
       this.variableListView.Name = "variableListView";
       this.variableListView.ShowItemToolTips = true;
Index: trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs	(revision 11435)
+++ trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs	(revision 11436)
@@ -58,4 +58,5 @@
       variableListView.SmallImageList.Images.AddRange(new Image[] {
         HeuristicLab.Common.Resources.VSImageLibrary.Error,
+        HeuristicLab.Common.Resources.VSImageLibrary.Warning,
         HeuristicLab.Common.Resources.VSImageLibrary.Object,
         HeuristicLab.Common.Resources.VSImageLibrary.Nothing
@@ -90,5 +91,4 @@
       variableListView.Items.Clear();
       itemListViewItemMapping.Clear();
-      RebuildImageList();
       if (Content != null) {
         Caption += " (" + Content.GetType().Name + ")";
@@ -141,7 +141,9 @@
       bool serializable = IsSerializable(variable);
       var listViewItem = new ListViewItem(new[] { variable.Key, value, type }) { ToolTipText = GetToolTipText(variable, serializable), Tag = variable };
-      if (serializable) {
-        listViewItem.ImageIndex = variable.Value == null ? 2 : 1;
-      } else listViewItem.ImageIndex = 0;
+      bool validIdentifier = SafeVariableNameRegex.IsMatch(variable.Key);
+      if (!serializable) listViewItem.ImageIndex = 0;
+      else if (!validIdentifier) listViewItem.ImageIndex = 1;
+      else if (variable.Value != null) listViewItem.ImageIndex = 2;
+      else listViewItem.ImageIndex = 3;
       variableListView.Items.Add(listViewItem);
       itemListViewItemMapping[variable.Key] = listViewItem;
@@ -172,7 +174,7 @@
         string type = variable.Value == null ? "null" : variable.Value.GetType().ToString();
         bool serializable = IsSerializable(variable);
-        if (serializable) {
-          listViewItem.ImageIndex = variable.Value == null ? 2 : 1;
-        } else listViewItem.ImageIndex = 0;
+        if (!serializable) listViewItem.ImageIndex = 0;
+        else if (variable.Value != null) listViewItem.ImageIndex = 2;
+        else listViewItem.ImageIndex = 3;
         listViewItem.SubItems[1].Text = value;
         listViewItem.SubItems[2].Text = type;
@@ -188,9 +190,22 @@
     }
     protected virtual void variableListView_KeyDown(object sender, KeyEventArgs e) {
-      if (e.KeyCode == Keys.Delete) {
-        if ((variableListView.SelectedItems.Count > 0) && !Locked && !ReadOnly) {
-          foreach (ListViewItem item in variableListView.SelectedItems)
-            Content.Remove(item.Text);
-        }
+      switch (e.KeyCode) {
+        case Keys.Delete:
+          if ((variableListView.SelectedItems.Count > 0) && !Locked && !ReadOnly) {
+            foreach (ListViewItem item in variableListView.SelectedItems)
+              Content.Remove(item.Text);
+          }
+          break;
+        case Keys.F2:
+          var focusedItem = variableListView.FocusedItem;
+          if (variableListView.LabelEdit && focusedItem.Selected)
+            focusedItem.BeginEdit();
+          break;
+        case Keys.A:
+          if (e.Modifiers.HasFlag(Keys.Control)) {
+            foreach (ListViewItem item in variableListView.Items)
+              item.Selected = true;
+          }
+          break;
       }
     }
@@ -211,24 +226,9 @@
     }
     protected virtual void variableListView_ItemDrag(object sender, ItemDragEventArgs e) {
-      if (!Locked) {
-        var items = new List<object>();
-        foreach (ListViewItem listViewItem in variableListView.SelectedItems) {
-          var item = (KeyValuePair<string, object>)listViewItem.Tag as KeyValuePair<string, object>?;
-          if (item != null) items.Add(item.Value.Value);
-        }
-
-        if (items.Count > 0) {
-          var data = new DataObject();
-          if (items.Count == 1) data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, items[0]);
-          else data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, items);
-          if (ReadOnly) {
-            DoDragDrop(data, DragDropEffects.Copy);
-          } else {
-            var result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
-            if ((result & DragDropEffects.Move) == DragDropEffects.Move) {
-              foreach (string item in items) Content.Remove(item);
-            }
-          }
-        }
+      if (!Locked && variableListView.SelectedItems.Count == 1) {
+        var listViewItem = variableListView.SelectedItems[0];
+        var item = (KeyValuePair<string, object>)listViewItem.Tag;
+        var data = new DataObject(HeuristicLab.Common.Constants.DragDropDataFormat, item.Value);
+        DoDragDrop(data, DragDropEffects.Copy);
       }
     }
@@ -239,27 +239,25 @@
       e.Effect = DragDropEffects.None;
       if (validDragOperation) {
-        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
-        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
-        else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
-        else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move;
-        else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link;
+        if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
       }
     }
     protected virtual void variableListView_DragDrop(object sender, DragEventArgs e) {
-      if (e.Effect != DragDropEffects.None) {
+      if (e.Effect == DragDropEffects.Copy) {
         object item = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
-        if (e.Effect.HasFlag(DragDropEffects.Copy)) {
-          var cloner = new Cloner();
-          var dc = item as IDeepCloneable;
-          if (dc != null) item = cloner.Clone(dc);
-        }
-        string name = GenerateNewVariableName();
+        var cloner = new Cloner();
+        var dc = item as IDeepCloneable;
+        if (dc != null) item = cloner.Clone(dc);
+        var namedItem = item as INamedItem;
+        bool nameValid = namedItem != null && !string.IsNullOrEmpty(namedItem.Name);
+        string name = nameValid ? GenerateNewVariableName(namedItem.Name, false) : GenerateNewVariableName();
         Content.Add(name, item);
         var listViewItem = variableListView.FindItemWithText(name);
-        listViewItem.BeginEdit();
+        if (!nameValid) listViewItem.BeginEdit();
       }
     }
 
     private readonly Regex SafeVariableNameRegex = new Regex("^[@]?[_a-zA-Z][_a-zA-Z0-9]*$");
+    private const string DefaultVariableName = "enter_name";
+
     private void variableListView_AfterLabelEdit(object sender, LabelEditEventArgs e) {
       string name = e.Label;
@@ -327,5 +325,4 @@
         foreach (var item in e.Items)
           RemoveVariable(item);
-        RebuildImageList();
         AdjustListViewColumnSizes();
       }
@@ -337,5 +334,4 @@
         foreach (var item in e.OldItems)
           RemoveVariable(item);
-        RebuildImageList();
         foreach (var item in e.Items)
           AddVariable(item);
@@ -352,5 +348,4 @@
           item.SubItems[2].Text = variable.Value.Value.GetType().ToString();
           item.ToolTipText = GetToolTipText(variable.Value, item.ImageIndex != 0);
-          return;
         }
       }
@@ -367,19 +362,4 @@
       foreach (ColumnHeader ch in variableListView.Columns)
         ch.Width = -2;
-    }
-    protected virtual void RebuildImageList() {
-      variableListView.SmallImageList.Images.Clear();
-      variableListView.SmallImageList.Images.AddRange(new Image[] {
-        HeuristicLab.Common.Resources.VSImageLibrary.Error,
-        HeuristicLab.Common.Resources.VSImageLibrary.Object,
-        HeuristicLab.Common.Resources.VSImageLibrary.Nothing
-      });
-      foreach (ListViewItem listViewItem in variableListView.Items) {
-        var variable = (KeyValuePair<string, object>)listViewItem.Tag;
-        bool serializable = IsSerializable(variable);
-        if (serializable) {
-          listViewItem.ImageIndex = variable.Value == null ? 2 : 1;
-        } else listViewItem.ImageIndex = 0;
-      }
     }
 
@@ -394,4 +374,6 @@
       };
       string toolTipText = string.Join(Environment.NewLine, lines);
+      if (!SafeVariableNameRegex.IsMatch(variable.Key))
+        toolTipText = "Caution: Identifier is no valid C# identifier!" + Environment.NewLine + toolTipText;
       if (!serializable)
         toolTipText = "Caution: Type is not serializable!" + Environment.NewLine + toolTipText;
@@ -399,10 +381,13 @@
     }
 
-    private string GenerateNewVariableName(string defaultName = "enter_name") {
+    private string GenerateNewVariableName(string defaultName = DefaultVariableName, bool generateValidIdentifier = true) {
+      if (generateValidIdentifier && !SafeVariableNameRegex.IsMatch(defaultName))
+        defaultName = DefaultVariableName;
       if (Content.ContainsKey(defaultName)) {
         int i = 1;
+        string formatString = generateValidIdentifier ? "{0}{1}" : "{0} ({1})";
         string newName;
         do {
-          newName = defaultName + i++;
+          newName = string.Format(formatString, defaultName, i++);
         } while (Content.ContainsKey(newName));
         return newName;
Index: trunk/sources/HeuristicLab.Scripting/3.3/CSharpScript.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting/3.3/CSharpScript.cs	(revision 11435)
+++ trunk/sources/HeuristicLab.Scripting/3.3/CSharpScript.cs	(revision 11436)
@@ -42,4 +42,5 @@
 // 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;
Index: trunk/sources/HeuristicLab.Scripting/3.3/CSharpScriptBase.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting/3.3/CSharpScriptBase.cs	(revision 11435)
+++ trunk/sources/HeuristicLab.Scripting/3.3/CSharpScriptBase.cs	(revision 11436)
@@ -27,4 +27,5 @@
 namespace HeuristicLab.Scripting {
   public abstract class CSharpScriptBase {
+    protected Variables variables;
     protected dynamic vars;
 
@@ -41,5 +42,5 @@
 
     internal void Execute(VariableStore variableStore) {
-      vars = new Variables(variableStore);
+      variables = vars = new Variables(variableStore);
       Main();
     }
