Index: /trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.Designer.cs	(revision 5237)
@@ -20,6 +20,4 @@
 #endregion
 
-using System;
-using System.Windows.Forms;
 
 namespace HeuristicLab.Core.Views {
@@ -29,20 +27,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        foreach (ListViewItem item in listView.Items) {
-          ((T)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-          ((T)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
-        }
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs	(revision 5237)
@@ -34,5 +34,5 @@
   public sealed partial class Clipboard<T> : HeuristicLab.MainForm.WindowsForms.Sidebar where T : class, IItem {
     private TypeSelectorDialog typeSelectorDialog;
-    private Dictionary<T, ListViewItem> itemListViewItemTable;
+    private Dictionary<T, ListViewItem> itemListViewItemMapping;
 
     private string itemsPath;
@@ -62,10 +62,22 @@
       ItemsPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                   Path.DirectorySeparatorChar + "HeuristicLab" + Path.DirectorySeparatorChar + "Clipboard";
-      itemListViewItemTable = new Dictionary<T, ListViewItem>();
+      itemListViewItemMapping = new Dictionary<T, ListViewItem>();
     }
     public Clipboard(string itemsPath) {
       InitializeComponent();
       ItemsPath = itemsPath;
-      itemListViewItemTable = new Dictionary<T, ListViewItem>();
+      itemListViewItemMapping = new Dictionary<T, ListViewItem>();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        foreach (T item in itemListViewItemMapping.Keys) {
+          item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
+          item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+        }
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
@@ -91,5 +103,6 @@
         Invoke(new Action<T>(AddItem), item);
       else {
-        if (!itemListViewItemTable.ContainsKey(item)) {
+        if (item == null) throw new ArgumentNullException("item", "Cannot add null item to clipboard.");
+        if (!itemListViewItemMapping.ContainsKey(item)) {
           ListViewItem listViewItem = new ListViewItem(item.ToString());
           listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
@@ -98,5 +111,5 @@
           listViewItem.Tag = item;
           listView.Items.Add(listViewItem);
-          itemListViewItemTable.Add(item, listViewItem);
+          itemListViewItemMapping.Add(item, listViewItem);
           item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
           item.ToStringChanged += new EventHandler(Item_ToStringChanged);
@@ -111,13 +124,10 @@
         Invoke(new Action<T>(RemoveItem), item);
       else {
-        if (itemListViewItemTable.ContainsKey(item)) {
+        if (itemListViewItemMapping.ContainsKey(item)) {
           item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
           item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
-          ListViewItem listViewItem = itemListViewItemTable[item];
+          ListViewItem listViewItem = itemListViewItemMapping[item];
           listViewItem.Remove();
-          foreach (ListViewItem other in listView.Items)
-            if (other.ImageIndex > listViewItem.ImageIndex) other.ImageIndex--;
-          listView.SmallImageList.Images.RemoveAt(listViewItem.ImageIndex);
-          itemListViewItemTable.Remove(item);
+          itemListViewItemMapping.Remove(item);
           sortAscendingButton.Enabled = sortDescendingButton.Enabled = listView.Items.Count > 1;
         }
@@ -178,5 +188,5 @@
 
       int i = 0;
-      T[] items = GetStorableItems(itemListViewItemTable.Keys);
+      T[] items = GetStorableItems(itemListViewItemMapping.Keys);
 
       foreach (T item in items) {
@@ -243,4 +253,5 @@
           foreach (ListViewItem item in listView.SelectedItems)
             RemoveItem((T)item.Tag);
+          RebuildImageList();
         }
       }
@@ -271,6 +282,8 @@
       } else {
         DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
-        if ((result & DragDropEffects.Move) == DragDropEffects.Move)
+        if ((result & DragDropEffects.Move) == DragDropEffects.Move) {
           RemoveItem(item);
+          RebuildImageList();
+        }
       }
     }
@@ -281,8 +294,8 @@
       if (!ReadOnly && (type != null) && (item != null)) {
         if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
-        else if (((e.KeyState & 4) == 4) && !itemListViewItemTable.ContainsKey(item)) e.Effect = DragDropEffects.Move;  // SHIFT key
+        else if (((e.KeyState & 4) == 4) && !itemListViewItemMapping.ContainsKey(item)) e.Effect = DragDropEffects.Move;  // SHIFT key
         else if ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy;
-        else if (((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) && !itemListViewItemTable.ContainsKey(item)) e.Effect = DragDropEffects.Move;
-        else if (((e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) && !itemListViewItemTable.ContainsKey(item)) e.Effect = DragDropEffects.Link;
+        else if (((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) && !itemListViewItemMapping.ContainsKey(item)) e.Effect = DragDropEffects.Move;
+        else if (((e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) && !itemListViewItemMapping.ContainsKey(item)) e.Effect = DragDropEffects.Link;
       }
     }
@@ -291,5 +304,10 @@
         T item = e.Data.GetData("Value") as T;
         if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) item = (T)item.Clone();
-        AddItem(item);
+        try {
+          AddItem(item);
+        }
+        catch (Exception ex) {
+          ErrorHandling.ShowErrorDialog(this, ex);
+        }
       }
     }
@@ -326,8 +344,9 @@
         foreach (ListViewItem item in listView.SelectedItems)
           RemoveItem((T)item.Tag);
+        RebuildImageList();
       }
     }
     private void saveButton_Click(object sender, EventArgs e) {
-      IEnumerable<T> items = itemListViewItemTable.Keys.Except(GetStorableItems(itemListViewItemTable.Keys));
+      IEnumerable<T> items = itemListViewItemMapping.Keys.Except(GetStorableItems(itemListViewItemMapping.Keys));
       if (items.Any()) {
         string itemNames = string.Join(Environment.NewLine, items.Select(item => item.ToString()).ToArray());
@@ -345,5 +364,5 @@
       else {
         T item = (T)sender;
-        ListViewItem listViewItem = itemListViewItemTable[item];
+        ListViewItem listViewItem = itemListViewItemMapping[item];
         int i = listViewItem.ImageIndex;
         listViewItem.ImageList.Images[i] = item.ItemImage;
@@ -357,5 +376,5 @@
       else {
         T item = (T)sender;
-        itemListViewItemTable[item].Text = item.ToString();
+        itemListViewItemMapping[item].Text = item.ToString();
         listView.Sort();
         AdjustListViewColumnSizes();
@@ -371,4 +390,11 @@
       }
     }
+    private void RebuildImageList() {
+      listView.SmallImageList.Images.Clear();
+      foreach (ListViewItem item in listView.Items) {
+        listView.SmallImageList.Images.Add(((T)item.Tag).ItemImage);
+        item.ImageIndex = listView.SmallImageList.Images.Count - 1;
+      }
+    }
     #endregion
   }
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs	(revision 5237)
@@ -29,21 +29,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary>
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        foreach (ListViewItem listViewItem in itemsListView.Items) {
-          T item = listViewItem.Tag as T;
-          if (item != null) item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-          if (item != null) item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
-        }
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Windows Form Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs	(revision 5237)
@@ -30,18 +30,11 @@
 
 namespace HeuristicLab.Core.Views {
-  /// <summary>
-  /// The visual representation of all variables in a specified scope.
-  /// </summary>
   [View("ItemArray View")]
   [Content(typeof(ItemArray<>), true)]
   [Content(typeof(IItemArray<>), false)]
   public partial class ItemArrayView<T> : ItemView where T : class, IItem {
+    protected Dictionary<T, List<ListViewItem>> itemListViewItemMapping;
     protected TypeSelectorDialog typeSelectorDialog;
 
-    /// <summary>
-    /// Gets or sets the scope whose variables to represent visually.
-    /// </summary>
-    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
-    /// No won data storage present.</remarks>
     public new IItemArray<T> Content {
       get { return (IItemArray<T>)base.Content; }
@@ -53,30 +46,26 @@
     }
 
-    /// <summary>
-    /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View".
-    /// </summary>
     public ItemArrayView() {
       InitializeComponent();
-    }
-
-    /// <summary>
-    /// Removes the eventhandlers from the underlying <see cref="IScope"/>.
-    /// </summary>
-    /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
+      itemListViewItemMapping = new Dictionary<T, List<ListViewItem>>();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     protected override void DeregisterContentEvents() {
       Content.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_ItemsReplaced);
       Content.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_ItemsMoved);
       Content.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_CollectionReset);
-      foreach (T item in Content) {
-        item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-        item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+      foreach (T item in itemListViewItemMapping.Keys) {
+        DeregisterItemEvents(item);
       }
       base.DeregisterContentEvents();
     }
-
-    /// <summary>
-    /// Adds eventhandlers to the underlying <see cref="IScope"/>.
-    /// </summary>
-    /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
@@ -85,4 +74,12 @@
       Content.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_CollectionReset);
     }
+    protected virtual void DeregisterItemEvents(T item) {
+      item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+    }
+    protected virtual void RegisterItemEvents(T item) {
+      item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged += new EventHandler(Item_ToStringChanged);
+    }
 
     protected override void OnContentChanged() {
@@ -92,5 +89,7 @@
       if (itemsListView.SelectedItems.Count == 1) selectedIndex = itemsListView.SelectedIndices[0];
 
-      while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
+      itemsListView.Items.Clear();
+      itemListViewItemMapping.Clear();
+      RebuildImageList();
       viewHost.Content = null;
       if (Content != null) {
@@ -140,5 +139,6 @@
         try {
           return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
-        } catch (Exception ex) {
+        }
+        catch (Exception ex) {
           ErrorHandling.ShowErrorDialog(this, ex);
         }
@@ -148,34 +148,49 @@
     protected virtual ListViewItem CreateListViewItem(T item) {
       ListViewItem listViewItem = new ListViewItem();
-      listViewItem.Text = item == null ? "null" : item.ToString();
-      listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
-      itemsListView.SmallImageList.Images.Add(item == null ? HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing : item.ItemImage);
-      listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
-      listViewItem.Tag = item;
+      if (item == null) {
+        listViewItem.Text = "null";
+        itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      } else {
+        listViewItem.Text = item.ToString();
+        listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
+        itemsListView.SmallImageList.Images.Add(item.ItemImage);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+        listViewItem.Tag = item;
+      }
       return listViewItem;
     }
     protected virtual void AddListViewItem(ListViewItem listViewItem) {
+      T item = (listViewItem.Tag as T);
       itemsListView.Items.Add(listViewItem);
-      if (listViewItem.Tag != null) {
-        ((T)listViewItem.Tag).ItemImageChanged += new EventHandler(Item_ItemImageChanged);
-        ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged);
+      if (item != null) {
+        if (!itemListViewItemMapping.ContainsKey(item)) {
+          RegisterItemEvents(item);
+          itemListViewItemMapping.Add(item, new List<ListViewItem>());
+        }
+        itemListViewItemMapping[item].Add(listViewItem);
       }
     }
     protected virtual void InsertListViewItem(int index, ListViewItem listViewItem) {
+      T item = (listViewItem.Tag as T);
       itemsListView.Items.Insert(index, listViewItem);
-      if (listViewItem.Tag != null) {
-        ((T)listViewItem.Tag).ItemImageChanged += new EventHandler(Item_ItemImageChanged);
-        ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged);
+      if (item != null) {
+        if (!itemListViewItemMapping.ContainsKey(item)) {
+          RegisterItemEvents(item);
+          itemListViewItemMapping.Add(item, new List<ListViewItem>());
+        }
+        itemListViewItemMapping[item].Add(listViewItem);
       }
     }
     protected virtual void RemoveListViewItem(ListViewItem listViewItem) {
-      if (listViewItem.Tag != null) {
-        ((T)listViewItem.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-        ((T)listViewItem.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
+      T item = (listViewItem.Tag as T);
+      if (item != null) {
+        itemListViewItemMapping[item].Remove(listViewItem);
+        if (itemListViewItemMapping[item].Count == 0) {
+          itemListViewItemMapping.Remove(item);
+          DeregisterItemEvents(item);
+        }
       }
       listViewItem.Remove();
-      foreach (ListViewItem other in itemsListView.Items)
-        if (other.ImageIndex > listViewItem.ImageIndex) other.ImageIndex--;
-      itemsListView.SmallImageList.Images.RemoveAt(listViewItem.ImageIndex);
     }
     protected virtual void UpdateListViewItemImage(ListViewItem listViewItem) {
@@ -190,4 +205,7 @@
       listViewItem.Text = item == null ? "null" : item.ToString();
       listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
+    }
+    protected virtual IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
+      return itemListViewItemMapping[item];
     }
 
@@ -347,4 +365,5 @@
         foreach (ListViewItem listViewItem in listViewItems)
           RemoveListViewItem(listViewItem);
+        RebuildImageList();
 
         foreach (IndexedItem<T> item in e.Items)
@@ -377,4 +396,5 @@
         foreach (ListViewItem listViewItem in listViewItems)
           RemoveListViewItem(listViewItem);
+        RebuildImageList();
 
         foreach (IndexedItem<T> item in e.Items)
@@ -391,8 +411,6 @@
       else {
         T item = (T)sender;
-        foreach (ListViewItem listViewItem in itemsListView.Items) {
-          if (((T)listViewItem.Tag) == item)
-            UpdateListViewItemImage(listViewItem);
-        }
+        foreach (ListViewItem listViewItem in GetListViewItemsForItem(item))
+          UpdateListViewItemImage(listViewItem);
       }
     }
@@ -402,8 +420,6 @@
       else {
         T item = (T)sender;
-        foreach (ListViewItem listViewItem in itemsListView.Items) {
-          if (((T)listViewItem.Tag) == item)
-            UpdateListViewItemText(listViewItem);
-        }
+        foreach (ListViewItem listViewItem in GetListViewItemsForItem(item))
+          UpdateListViewItemText(listViewItem);
       }
     }
@@ -417,4 +433,11 @@
       }
     }
+    private void RebuildImageList() {
+      itemsListView.SmallImageList.Images.Clear();
+      foreach (ListViewItem item in itemsListView.Items) {
+        itemsListView.SmallImageList.Images.Add(((T)item.Tag).ItemImage);
+        item.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      }
+    }
     #endregion
   }
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs	(revision 5237)
@@ -20,5 +20,4 @@
 #endregion
 
-using System;
 using System.Windows.Forms;
 
@@ -29,20 +28,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary>
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        foreach (ListViewItem item in itemsListView.Items) {
-          ((T)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-          ((T)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
-        }
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Windows Form Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs	(revision 5237)
@@ -34,5 +34,5 @@
   [Content(typeof(IItemCollection<>), false)]
   public partial class ItemCollectionView<T> : ItemView where T : class, IItem {
-    private Dictionary<T, List<ListViewItem>> listViewItemMapping;
+    protected Dictionary<T, List<ListViewItem>> itemListViewItemMapping;
     protected TypeSelectorDialog typeSelectorDialog;
 
@@ -48,5 +48,13 @@
     public ItemCollectionView() {
       InitializeComponent();
-      listViewItemMapping = new Dictionary<T, List<ListViewItem>>();
+      itemListViewItemMapping = new Dictionary<T, List<ListViewItem>>();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
@@ -55,7 +63,6 @@
       Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<T>(Content_ItemsRemoved);
       Content.CollectionReset -= new CollectionItemsChangedEventHandler<T>(Content_CollectionReset);
-      foreach (T item in listViewItemMapping.Keys) {
-        item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-        item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+      foreach (T item in itemListViewItemMapping.Keys) {
+        DeregisterItemEvents(item);
       }
       base.DeregisterContentEvents();
@@ -67,8 +74,17 @@
       Content.CollectionReset += new CollectionItemsChangedEventHandler<T>(Content_CollectionReset);
     }
+    protected virtual void DeregisterItemEvents(T item) {
+      item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+    }
+    protected virtual void RegisterItemEvents(T item) {
+      item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged += new EventHandler(Item_ToStringChanged);
+    }
 
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
+      itemsListView.Items.Clear();
+      itemListViewItemMapping.Clear();
       RebuildImageList();
       viewHost.Content = null;
@@ -112,5 +128,6 @@
         try {
           return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
-        } catch (Exception ex) {
+        }
+        catch (Exception ex) {
           ErrorHandling.ShowErrorDialog(this, ex);
         }
@@ -120,9 +137,15 @@
     protected virtual ListViewItem CreateListViewItem(T item) {
       ListViewItem listViewItem = new ListViewItem();
-      listViewItem.Text = item.ToString();
-      listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
-      listViewItem.Tag = item;
-      itemsListView.SmallImageList.Images.Add(item.ItemImage);
-      listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      if (item == null) {
+        listViewItem.Text = "null";
+        itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      } else {
+        listViewItem.Text = item.ToString();
+        listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
+        itemsListView.SmallImageList.Images.Add(item.ItemImage);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+        listViewItem.Tag = item;
+      }
       return listViewItem;
     }
@@ -130,10 +153,11 @@
       T item = (listViewItem.Tag as T);
       itemsListView.Items.Add(listViewItem);
-      if (!listViewItemMapping.ContainsKey(item)) {
-        item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
-        item.ToStringChanged += new EventHandler(Item_ToStringChanged);
-        listViewItemMapping.Add(item, new List<ListViewItem>());
-      }
-      listViewItemMapping[item].Add(listViewItem);
+      if (item != null) {
+        if (!itemListViewItemMapping.ContainsKey(item)) {
+          RegisterItemEvents(item);
+          itemListViewItemMapping.Add(item, new List<ListViewItem>());
+        }
+        itemListViewItemMapping[item].Add(listViewItem);
+      }
       sortAscendingButton.Enabled = itemsListView.Items.Count > 1;
       sortDescendingButton.Enabled = itemsListView.Items.Count > 1;
@@ -141,9 +165,10 @@
     protected virtual void RemoveListViewItem(ListViewItem listViewItem) {
       T item = (listViewItem.Tag as T);
-      listViewItemMapping[item].Remove(listViewItem);
-      if (listViewItemMapping[item].Count == 0) {
-        listViewItemMapping.Remove(item);
-        item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-        item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+      if (item != null) {
+        itemListViewItemMapping[item].Remove(listViewItem);
+        if (itemListViewItemMapping[item].Count == 0) {
+          itemListViewItemMapping.Remove(item);
+          DeregisterItemEvents(item);
+        }
       }
       listViewItem.Remove();
@@ -152,15 +177,25 @@
     }
     protected virtual void UpdateListViewItemImage(ListViewItem listViewItem) {
+      T item = listViewItem.Tag as T;
       int i = listViewItem.ImageIndex;
-      listViewItem.ImageList.Images[i] = ((T)listViewItem.Tag).ItemImage;
+      listViewItem.ImageList.Images[i] = item == null ? HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing : item.ItemImage;
       listViewItem.ImageIndex = -1;
       listViewItem.ImageIndex = i;
     }
     protected virtual void UpdateListViewItemText(ListViewItem listViewItem) {
-      if (!listViewItem.Text.Equals(listViewItem.Tag.ToString()))
-        listViewItem.Text = listViewItem.Tag.ToString();
+      T item = listViewItem.Tag as T;
+      listViewItem.Text = item == null ? "null" : item.ToString();
+      listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
     }
     protected virtual IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
-      return listViewItemMapping[item];
+      if (item == null) {
+        List<ListViewItem> listViewItems = new List<ListViewItem>();
+        foreach (ListViewItem listViewItem in itemsListView.Items) {
+          if (listViewItem.Tag == null) listViewItems.Add(listViewItem);
+        }
+        return listViewItems;
+      } else {
+        return itemListViewItemMapping[item];
+      }
     }
 
@@ -190,9 +225,11 @@
     protected virtual void itemsListView_DoubleClick(object sender, EventArgs e) {
       if (itemsListView.SelectedItems.Count == 1) {
-        T item = (T)itemsListView.SelectedItems[0].Tag;
-        IContentView view = MainFormManager.MainForm.ShowContent(item);
-        if (view != null) {
-          view.ReadOnly = ReadOnly;
-          view.Locked = Locked;
+        T item = itemsListView.SelectedItems[0].Tag as T;
+        if (item != null) {
+          IContentView view = MainFormManager.MainForm.ShowContent(item);
+          if (view != null) {
+            view.ReadOnly = ReadOnly;
+            view.Locked = Locked;
+          }
         }
       }
@@ -201,14 +238,16 @@
       if (!Locked) {
         ListViewItem listViewItem = (ListViewItem)e.Item;
-        T item = (T)listViewItem.Tag;
-        DataObject data = new DataObject();
-        data.SetData("Type", item.GetType());
-        data.SetData("Value", item);
-        if (Content.IsReadOnly || ReadOnly) {
-          DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
-        } else {
-          DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
-          if ((result & DragDropEffects.Move) == DragDropEffects.Move)
-            Content.Remove(item);
+        T item = listViewItem.Tag as T;
+        if (item != null) {
+          DataObject data = new DataObject();
+          data.SetData("Type", item.GetType());
+          data.SetData("Value", item);
+          if (Content.IsReadOnly || ReadOnly) {
+            DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
+          } else {
+            DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
+            if ((result & DragDropEffects.Move) == DragDropEffects.Move)
+              Content.Remove(item);
+          }
         }
       }
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs	(revision 5237)
@@ -29,20 +29,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary>
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        foreach (ListViewItem item in itemsListView.Items) {
-          ((T)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-          ((T)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
-        }
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Windows Form Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs	(revision 5237)
@@ -30,18 +30,11 @@
 
 namespace HeuristicLab.Core.Views {
-  /// <summary>
-  /// The visual representation of all variables in a specified scope.
-  /// </summary>
   [View("ItemList View")]
   [Content(typeof(ItemList<>), true)]
   [Content(typeof(IItemList<>), false)]
   public partial class ItemListView<T> : ItemView where T : class, IItem {
+    protected Dictionary<T, List<ListViewItem>> itemListViewItemMapping;
     protected TypeSelectorDialog typeSelectorDialog;
 
-    /// <summary>
-    /// Gets or sets the scope whose variables to represent visually.
-    /// </summary>
-    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
-    /// No won data storage present.</remarks>
     public new IItemList<T> Content {
       get { return (IItemList<T>)base.Content; }
@@ -53,15 +46,17 @@
     }
 
-    /// <summary>
-    /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View".
-    /// </summary>
     public ItemListView() {
       InitializeComponent();
-    }
-
-    /// <summary>
-    /// Removes the eventhandlers from the underlying <see cref="IScope"/>.
-    /// </summary>
-    /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
+      itemListViewItemMapping = new Dictionary<T, List<ListViewItem>>();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     protected override void DeregisterContentEvents() {
       Content.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_ItemsAdded);
@@ -70,15 +65,9 @@
       Content.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_ItemsMoved);
       Content.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_CollectionReset);
-      foreach (T item in Content) {
-        item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-        item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+      foreach (T item in itemListViewItemMapping.Keys) {
+        DeregisterItemEvents(item);
       }
       base.DeregisterContentEvents();
     }
-
-    /// <summary>
-    /// Adds eventhandlers to the underlying <see cref="IScope"/>.
-    /// </summary>
-    /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks>
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
@@ -89,4 +78,12 @@
       Content.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<T>>(Content_CollectionReset);
     }
+    protected virtual void DeregisterItemEvents(T item) {
+      item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+    }
+    protected virtual void RegisterItemEvents(T item) {
+      item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged += new EventHandler(Item_ToStringChanged);
+    }
 
     protected override void OnContentChanged() {
@@ -96,5 +93,7 @@
       if (itemsListView.SelectedItems.Count == 1) selectedIndex = itemsListView.SelectedIndices[0];
 
-      while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
+      itemsListView.Items.Clear();
+      itemListViewItemMapping.Clear();
+      RebuildImageList();
       viewHost.Content = null;
       if (Content != null) {
@@ -143,5 +142,6 @@
         try {
           return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
-        } catch (Exception ex) {
+        }
+        catch (Exception ex) {
           ErrorHandling.ShowErrorDialog(this, ex);
         }
@@ -151,38 +151,64 @@
     protected virtual ListViewItem CreateListViewItem(T item) {
       ListViewItem listViewItem = new ListViewItem();
-      listViewItem.Text = item.ToString();
-      listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
-      listViewItem.Tag = item;
-      itemsListView.SmallImageList.Images.Add(item.ItemImage);
-      listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      if (item == null) {
+        listViewItem.Text = "null";
+        itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      } else {
+        listViewItem.Text = item.ToString();
+        listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
+        itemsListView.SmallImageList.Images.Add(item.ItemImage);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+        listViewItem.Tag = item;
+      }
       return listViewItem;
     }
     protected virtual void AddListViewItem(ListViewItem listViewItem) {
+      T item = (listViewItem.Tag as T);
       itemsListView.Items.Add(listViewItem);
-      ((T)listViewItem.Tag).ItemImageChanged += new EventHandler(Item_ItemImageChanged);
-      ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged);
+      if (item != null) {
+        if (!itemListViewItemMapping.ContainsKey(item)) {
+          RegisterItemEvents(item);
+          itemListViewItemMapping.Add(item, new List<ListViewItem>());
+        }
+        itemListViewItemMapping[item].Add(listViewItem);
+      }
     }
     protected virtual void InsertListViewItem(int index, ListViewItem listViewItem) {
+      T item = (listViewItem.Tag as T);
       itemsListView.Items.Insert(index, listViewItem);
-      ((T)listViewItem.Tag).ItemImageChanged += new EventHandler(Item_ItemImageChanged);
-      ((T)listViewItem.Tag).ToStringChanged += new EventHandler(Item_ToStringChanged);
+      if (item != null) {
+        if (!itemListViewItemMapping.ContainsKey(item)) {
+          RegisterItemEvents(item);
+          itemListViewItemMapping.Add(item, new List<ListViewItem>());
+        }
+        itemListViewItemMapping[item].Add(listViewItem);
+      }
     }
     protected virtual void RemoveListViewItem(ListViewItem listViewItem) {
-      ((T)listViewItem.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-      ((T)listViewItem.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
+      T item = (listViewItem.Tag as T);
+      if (item != null) {
+        itemListViewItemMapping[item].Remove(listViewItem);
+        if (itemListViewItemMapping[item].Count == 0) {
+          itemListViewItemMapping.Remove(item);
+          DeregisterItemEvents(item);
+        }
+      }
       listViewItem.Remove();
-      foreach (ListViewItem other in itemsListView.Items)
-        if (other.ImageIndex > listViewItem.ImageIndex) other.ImageIndex--;
-      itemsListView.SmallImageList.Images.RemoveAt(listViewItem.ImageIndex);
     }
     protected virtual void UpdateListViewItemImage(ListViewItem listViewItem) {
+      T item = listViewItem.Tag as T;
       int i = listViewItem.ImageIndex;
-      listViewItem.ImageList.Images[i] = ((T)listViewItem.Tag).ItemImage;
+      listViewItem.ImageList.Images[i] = item == null ? HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing : item.ItemImage;
       listViewItem.ImageIndex = -1;
       listViewItem.ImageIndex = i;
     }
     protected virtual void UpdateListViewItemText(ListViewItem listViewItem) {
-      if (!listViewItem.Text.Equals(listViewItem.Tag.ToString()))
-        listViewItem.Text = listViewItem.Tag.ToString();
+      T item = listViewItem.Tag as T;
+      listViewItem.Text = item == null ? "null" : item.ToString();
+      listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
+    }
+    protected virtual IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
+      return itemListViewItemMapping[item];
     }
 
@@ -222,9 +248,11 @@
     protected virtual void itemsListView_DoubleClick(object sender, EventArgs e) {
       if (itemsListView.SelectedItems.Count == 1) {
-        T item = (T)itemsListView.SelectedItems[0].Tag;
-        IContentView view = MainFormManager.MainForm.ShowContent(item);
-        if (view != null) {
-          view.ReadOnly = ReadOnly;
-          view.Locked = Locked;
+        T item = itemsListView.SelectedItems[0].Tag as T;
+        if (item != null) {
+          IContentView view = MainFormManager.MainForm.ShowContent(item);
+          if (view != null) {
+            view.ReadOnly = ReadOnly;
+            view.Locked = Locked;
+          }
         }
       }
@@ -234,14 +262,16 @@
       if (!Locked) {
         ListViewItem listViewItem = (ListViewItem)e.Item;
-        T item = (T)listViewItem.Tag;
-        DataObject data = new DataObject();
-        data.SetData("Type", item.GetType());
-        data.SetData("Value", item);
-        if (Content.IsReadOnly || ReadOnly) {
-          DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
-        } else {
-          DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
-          if ((result & DragDropEffects.Move) == DragDropEffects.Move)
-            Content.RemoveAt(listViewItem.Index);
+        T item = listViewItem.Tag as T;
+        if (item != null) {
+          DataObject data = new DataObject();
+          data.SetData("Type", item.GetType());
+          data.SetData("Value", item);
+          if (Content.IsReadOnly || ReadOnly) {
+            DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
+          } else {
+            DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
+            if ((result & DragDropEffects.Move) == DragDropEffects.Move)
+              Content.RemoveAt(listViewItem.Index);
+          }
         }
       }
@@ -337,4 +367,5 @@
         foreach (ListViewItem listViewItem in listViewItems)
           RemoveListViewItem(listViewItem);
+        RebuildImageList();
       }
     }
@@ -351,4 +382,5 @@
         foreach (ListViewItem listViewItem in listViewItems)
           RemoveListViewItem(listViewItem);
+        RebuildImageList();
 
         foreach (IndexedItem<T> item in e.Items)
@@ -381,4 +413,5 @@
         foreach (ListViewItem listViewItem in listViewItems)
           RemoveListViewItem(listViewItem);
+        RebuildImageList();
 
         foreach (IndexedItem<T> item in e.Items)
@@ -395,8 +428,6 @@
       else {
         T item = (T)sender;
-        foreach (ListViewItem listViewItem in itemsListView.Items) {
-          if (((T)listViewItem.Tag) == item)
-            UpdateListViewItemImage(listViewItem);
-        }
+        foreach (ListViewItem listViewItem in GetListViewItemsForItem(item))
+          UpdateListViewItemImage(listViewItem);
       }
     }
@@ -406,8 +437,6 @@
       else {
         T item = (T)sender;
-        foreach (ListViewItem listViewItem in itemsListView.Items) {
-          if (((T)listViewItem.Tag) == item)
-            UpdateListViewItemText(listViewItem);
-        }
+        foreach (ListViewItem listViewItem in GetListViewItemsForItem(item))
+          UpdateListViewItemText(listViewItem);
       }
     }
@@ -421,4 +450,11 @@
       }
     }
+    private void RebuildImageList() {
+      itemsListView.SmallImageList.Images.Clear();
+      foreach (ListViewItem item in itemsListView.Items) {
+        itemsListView.SmallImageList.Images.Add(((T)item.Tag).ItemImage);
+        item.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      }
+    }
     #endregion
   }
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs	(revision 5237)
@@ -20,5 +20,4 @@
 #endregion
 
-using System.Collections.Generic;
 using System.Windows.Forms;
 using HeuristicLab.MainForm;
@@ -34,30 +33,6 @@
     }
 
-    private Dictionary<T, ListViewItem> listViewItemDictionary;
-    protected Dictionary<T, ListViewItem> ListViewItemDictionary {
-      get { return listViewItemDictionary; }
-    }
-
     public ItemSetView() {
-      listViewItemDictionary = new Dictionary<T, ListViewItem>();
       InitializeComponent();
-    }
-
-    protected override void OnContentChanged() {
-      base.OnContentChanged();
-      if (Content != null)
-        Caption += " (" + Content.GetType().Name + ")";
-    }
-
-    protected override void AddListViewItem(ListViewItem listViewItem) {
-      ListViewItemDictionary.Add((T)listViewItem.Tag, listViewItem);
-      base.AddListViewItem(listViewItem);
-    }
-    protected override void RemoveListViewItem(ListViewItem listViewItem) {
-      base.RemoveListViewItem(listViewItem);
-      ListViewItemDictionary.Remove((T)listViewItem.Tag);
-    }
-    protected override IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
-      return new ListViewItem[] { listViewItemDictionary[item] };
     }
   }
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemCollectionView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemCollectionView.cs	(revision 5237)
@@ -20,5 +20,4 @@
 #endregion
 
-using System.Collections.Generic;
 using System.Windows.Forms;
 using HeuristicLab.Collections;
@@ -34,11 +33,5 @@
     }
 
-    private Dictionary<T, ListViewItem> listViewItemDictionary;
-    protected Dictionary<T, ListViewItem> ListViewItemDictionary {
-      get { return listViewItemDictionary; }
-    }
-
     public NamedItemCollectionView() {
-      listViewItemDictionary = new Dictionary<T, ListViewItem>();
       InitializeComponent();
     }
@@ -75,20 +68,8 @@
     protected override ListViewItem CreateListViewItem(T item) {
       ListViewItem listViewItem = base.CreateListViewItem(item);
-      listViewItem.ToolTipText = string.IsNullOrEmpty(item.Description) ? item.ItemName : item.ItemName + ": " + item.Description;
+      if ((item != null) && !string.IsNullOrEmpty(item.Description)) {
+        listViewItem.ToolTipText = item.ItemName + ": " + item.Description;
+      }
       return listViewItem;
-    }
-    protected override void AddListViewItem(ListViewItem listViewItem) {
-      ListViewItemDictionary.Add((T)listViewItem.Tag, listViewItem);
-      base.AddListViewItem(listViewItem);
-    }
-    protected override void RemoveListViewItem(ListViewItem listViewItem) {
-      base.RemoveListViewItem(listViewItem);
-      ListViewItemDictionary.Remove((T)listViewItem.Tag);
-    }
-    protected override IEnumerable<ListViewItem> GetListViewItemsForItem(T item) {
-      ListViewItem listViewItem = null;
-      listViewItemDictionary.TryGetValue(item, out listViewItem);
-      if (listViewItem != null) return new ListViewItem[] { listViewItem };
-      else return new ListViewItem[0];
     }
 
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.Designer.cs	(revision 5237)
@@ -26,19 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (graphTreeView.Nodes.Count > 0) {
-          RemoveTreeNode(graphTreeView.Nodes[0]);
-          graphTreeView.Nodes.Clear();
-        }
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs	(revision 5237)
@@ -30,7 +30,4 @@
 
 namespace HeuristicLab.Core.Views {
-  /// <summary>
-  /// The visual representation of an <see cref="OperatorGraph"/>.
-  /// </summary>
   [View("Operator View (Successors)")]
   [Content(typeof(IOperator), false)]
@@ -40,9 +37,4 @@
     private Dictionary<IKeyedItemCollection<string, IParameter>, IOperator> parametersOperatorTable;
 
-    /// <summary>
-    /// Gets or sets the operator graph to represent visually.
-    /// </summary>
-    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
-    /// No own data storage present.</remarks>
     public new IOperator Content {
       get { return (IOperator)base.Content; }
@@ -61,7 +53,4 @@
     }
 
-    /// <summary>
-    /// Initializes a new instance of <see cref="OperatorGraphView"/> with caption "Operator Graph".
-    /// </summary>
     public OperatorTreeView() {
       InitializeComponent();
@@ -72,8 +61,15 @@
     }
 
-    /// <summary>
-    /// Updates all controls with the latest data of the model.
-    /// </summary>
-    /// <remarks>Calls <see cref="ViewBase.UpdateControls"/> of base class <see cref="ViewBase"/>.</remarks>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (graphTreeView.Nodes.Count > 0) {
+          RemoveTreeNode(graphTreeView.Nodes[0]);
+          graphTreeView.Nodes.Clear();
+        }
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     protected override void OnContentChanged() {
       base.OnContentChanged();
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.Designer.cs	(revision 5237)
@@ -27,16 +27,4 @@
     private System.ComponentModel.IContainer components = null;
 
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (createParameterDialog != null) createParameterDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
     #region Component Designer generated code
 
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs	(revision 5237)
@@ -38,4 +38,12 @@
     }
 
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (createParameterDialog != null) createParameterDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     protected override IParameter CreateItem() {
       if (createParameterDialog == null) createParameterDialog = new CreateParameterDialog();
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.Designer.cs	(revision 5237)
@@ -26,18 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (scopesTreeView.Nodes.Count > 0) {
-          ClearTreeNode(scopesTreeView.Nodes[0]);
-        }
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.cs	(revision 5237)
@@ -57,4 +57,18 @@
     }
 
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (scopesTreeView.Nodes.Count > 0) {
+          ClearTreeNode(scopesTreeView.Nodes[0]);
+        }
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     /// <summary>
     /// Updates all controls with the latest data of the model.
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.Designer.cs	(revision 5237)
@@ -26,16 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs	(revision 5237)
@@ -74,4 +74,12 @@
       currentSearchString = string.Empty;
       selectedType = null;
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.Designer.cs	(revision 5237)
@@ -27,16 +27,4 @@
     private System.ComponentModel.IContainer components = null;
 
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (createParameterDialog != null) createParameterDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
     #region Component Designer generated code
 
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.cs	(revision 5237)
@@ -38,4 +38,12 @@
     }
 
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (createParameterDialog != null) createParameterDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     protected override IValueParameter CreateItem() {
       if (createParameterDialog == null) {
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.Designer.cs	(revision 5237)
@@ -26,16 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs	(revision 5237)
@@ -51,4 +51,16 @@
     public VariableView() {
       InitializeComponent();
+    }
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.Designer.cs	(revision 5237)
@@ -26,17 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary>
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (View != null)
-        View.CaptionChanged -= new System.EventHandler(View_CaptionChanged);
-      if (disposing && (components != null)) {
-        components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Windows Form Designer generated code
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.cs	(revision 5237)
@@ -73,4 +73,14 @@
       }
     }
+
+    protected override void Dispose(bool disposing) {
+      if (View != null)
+        View.CaptionChanged -= new System.EventHandler(View_CaptionChanged);
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     private IView view;
     public IView View {
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DocumentForm.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DocumentForm.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DocumentForm.Designer.cs	(revision 5237)
@@ -26,17 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary>
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (view != null)
-        view.CaptionChanged -= new System.EventHandler(View_CaptionChanged);
-      if (disposing && (components != null)) {
-        components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Windows Form Designer generated code
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DocumentForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DocumentForm.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DocumentForm.cs	(revision 5237)
@@ -50,4 +50,13 @@
     }
 
+    protected override void Dispose(bool disposing) {
+      if (view != null)
+        view.CaptionChanged -= new System.EventHandler(View_CaptionChanged);
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
     private void UpdateText() {
       if (InvokeRequired)
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForm.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForm.cs	(revision 5237)
@@ -430,5 +430,10 @@
     private void ToolStripItemClicked(object sender, EventArgs e) {
       System.Windows.Forms.ToolStripItem item = (System.Windows.Forms.ToolStripItem)sender;
-      ((IActionUserInterfaceItem)item.Tag).Execute();
+      try {
+        ((IActionUserInterfaceItem)item.Tag).Execute();
+      }
+      catch (Exception ex) {
+        ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex);
+      }
     }
     #endregion
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs	(revision 5237)
@@ -26,16 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (problemTypeSelectorDialog != null) problemTypeSelectorDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs	(revision 5237)
@@ -49,4 +49,12 @@
     public AlgorithmView() {
       InitializeComponent();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (problemTypeSelectorDialog != null) problemTypeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.Designer.cs	(revision 5237)
@@ -26,16 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (algorithmTypeSelectorDialog != null) algorithmTypeSelectorDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs	(revision 5237)
@@ -47,4 +47,12 @@
     public BatchRunView() {
       InitializeComponent();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (algorithmTypeSelectorDialog != null) algorithmTypeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs	(revision 5237)
@@ -23,5 +23,4 @@
 using System.Drawing;
 using System.Windows.Forms;
-using HeuristicLab.Collections;
 using HeuristicLab.Core;
 using HeuristicLab.Core.Views;
@@ -60,47 +59,20 @@
     protected override ListViewItem CreateListViewItem(IRunCollectionConstraint item) {
       ListViewItem listViewItem = base.CreateListViewItem(item);
-      if (item.Active)
-        listViewItem.Font = new Font(listViewItem.Font, FontStyle.Bold);
-      else
-        listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular);
+      if (item != null) {
+        listViewItem.Font = item.Active ? new Font(listViewItem.Font, FontStyle.Bold) : new Font(listViewItem.Font, FontStyle.Regular);
+      }
       return listViewItem;
     }
 
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      foreach (IRunCollectionConstraint constraint in Content)
-        RegisterConstraintEvents(constraint);
+    protected override void DeregisterItemEvents(IRunCollectionConstraint item) {
+      item.ActiveChanged -= new EventHandler(Item_ActiveChanged);
+      base.DeregisterItemEvents(item);
     }
-    protected override void DeregisterContentEvents() {
-      base.DeregisterContentEvents();
-      foreach (IRunCollectionConstraint constraint in Content)
-        DeregisterConstraintEvents(constraint);
-    }
-    protected override void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
-      base.Content_ItemsAdded(sender, e);
-      foreach (IRunCollectionConstraint constraint in e.Items)
-        RegisterConstraintEvents(constraint);
-
-    }
-    protected override void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
-      base.Content_ItemsRemoved(sender, e);
-      foreach (IRunCollectionConstraint constraint in e.Items)
-        DeregisterConstraintEvents(constraint);
-    }
-    protected override void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) {
-      base.Content_CollectionReset(sender, e);
-      foreach (IRunCollectionConstraint constraint in e.OldItems)
-        RegisterConstraintEvents(constraint);
-      foreach (IRunCollectionConstraint constraint in e.Items)
-        DeregisterConstraintEvents(constraint);
+    protected override void RegisterItemEvents(IRunCollectionConstraint item) {
+      base.RegisterItemEvents(item);
+      item.ActiveChanged += new EventHandler(Item_ActiveChanged);
     }
 
-    protected virtual void RegisterConstraintEvents(IRunCollectionConstraint constraint) {
-      constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged);
-    }
-    protected virtual void DeregisterConstraintEvents(IRunCollectionConstraint constraint) {
-      constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged);
-    }
-    protected virtual void constraint_ActiveChanged(object sender, EventArgs e) {
+    protected virtual void Item_ActiveChanged(object sender, EventArgs e) {
       IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender;
       foreach (ListViewItem listViewItem in GetListViewItemsForItem(constraint)) {
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs	(revision 5237)
@@ -20,5 +20,4 @@
 #endregion
 
-using System;
 using System.Windows.Forms;
 
@@ -36,8 +35,4 @@
     protected override void Dispose(bool disposing) {
       if (disposing) {
-        foreach (ListViewItem item in itemsListView.Items) {
-          ((IRun)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-          ((IRun)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
-        }
         if (components != null) components.Dispose();
       }
Index: /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs	(revision 5237)
@@ -36,5 +36,5 @@
   [Content(typeof(IItemCollection<IRun>), false)]
   public sealed partial class RunCollectionView : ItemView {
-    private Dictionary<IRun, List<ListViewItem>> runListViewItemMapping;
+    private Dictionary<IRun, List<ListViewItem>> itemListViewItemMapping;
 
     public new IItemCollection<IRun> Content {
@@ -54,5 +54,5 @@
       InitializeComponent();
       itemsGroupBox.Text = "Runs";
-      runListViewItemMapping = new Dictionary<IRun, List<ListViewItem>>();
+      itemListViewItemMapping = new Dictionary<IRun, List<ListViewItem>>();
     }
 
@@ -61,5 +61,7 @@
       Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
       Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
-      DeregisterRunEvents(Content);
+      foreach (IRun run in itemListViewItemMapping.Keys) {
+        DeregisterItemEvents(run);
+      }
       base.DeregisterContentEvents();
     }
@@ -69,13 +71,14 @@
       Content.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved);
       Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
-      RegisterRunEvents(Content);
-    }
-    private void RegisterRunEvents(IEnumerable<IRun> runs) {
-      foreach (IRun run in runs)
-        run.Changed += new EventHandler(Run_Changed);
-    }
-    private void DeregisterRunEvents(IEnumerable<IRun> runs) {
-      foreach (IRun run in runs)
-        run.Changed -= new EventHandler(Run_Changed);
+    }
+    private void DeregisterItemEvents(IRun item) {
+      item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+      item.Changed -= new EventHandler(Item_Changed);
+    }
+    private void RegisterItemEvents(IRun item) {
+      item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
+      item.ToStringChanged += new EventHandler(Item_ToStringChanged);
+      item.Changed += new EventHandler(Item_Changed);
     }
 
@@ -101,5 +104,7 @@
         selectedName = ((IRun)itemsListView.SelectedItems[0].Tag).Name;
 
-      while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
+      itemsListView.Items.Clear();
+      itemListViewItemMapping.Clear();
+      RebuildImageList();
       viewHost.Content = null;
 
@@ -148,16 +153,22 @@
     private ListViewItem CreateListViewItem(IRun item) {
       ListViewItem listViewItem = new ListViewItem();
-      listViewItem.Text = item.ToString();
-      listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
-      itemsListView.SmallImageList.Images.Add(item.ItemImage);
-      listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
-      listViewItem.Tag = item;
-
-      if (item.Visible) {
-        listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular);
-        listViewItem.ForeColor = item.Color;
+      if (item == null) {
+        listViewItem.Text = "null";
+        itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
       } else {
-        listViewItem.Font = new Font(listViewItem.Font, FontStyle.Italic);
-        listViewItem.ForeColor = Color.LightGray;
+        listViewItem.Text = item.ToString();
+        listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription;
+        itemsListView.SmallImageList.Images.Add(item.ItemImage);
+        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+        listViewItem.Tag = item;
+
+        if (item.Visible) {
+          listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular);
+          listViewItem.ForeColor = item.Color;
+        } else {
+          listViewItem.Font = new Font(listViewItem.Font, FontStyle.Italic);
+          listViewItem.ForeColor = Color.LightGray;
+        }
       }
       return listViewItem;
@@ -167,9 +178,9 @@
       IRun run = listViewItem.Tag as IRun;
       if (run != null) {
-        if (!runListViewItemMapping.ContainsKey(run))
-          runListViewItemMapping.Add(run, new List<ListViewItem>());
-        runListViewItemMapping[run].Add(listViewItem);
-        run.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
-        run.ToStringChanged += new EventHandler(Item_ToStringChanged);
+        if (!itemListViewItemMapping.ContainsKey(run)) {
+          itemListViewItemMapping.Add(run, new List<ListViewItem>());
+          RegisterItemEvents(run);
+        }
+        itemListViewItemMapping[run].Add(listViewItem);
       }
     }
@@ -177,28 +188,34 @@
       IRun run = listViewItem.Tag as IRun;
       if (run != null) {
-        runListViewItemMapping[run].Remove(listViewItem);
-        if (runListViewItemMapping[run].Count == 0) {
-          runListViewItemMapping.Remove(run);
-          run.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
-          run.ToStringChanged -= new EventHandler(Item_ToStringChanged);
+        itemListViewItemMapping[run].Remove(listViewItem);
+        if (itemListViewItemMapping[run].Count == 0) {
+          DeregisterItemEvents(run);
+          itemListViewItemMapping.Remove(run);
         }
       }
       listViewItem.Remove();
-      foreach (ListViewItem other in itemsListView.Items)
-        if (other.ImageIndex > listViewItem.ImageIndex) other.ImageIndex--;
-      itemsListView.SmallImageList.Images.RemoveAt(listViewItem.ImageIndex);
     }
     private void UpdateListViewItemImage(ListViewItem listViewItem) {
+      IRun item = listViewItem.Tag as IRun;
       int i = listViewItem.ImageIndex;
-      listViewItem.ImageList.Images[i] = ((IRun)listViewItem.Tag).ItemImage;
+      listViewItem.ImageList.Images[i] = item == null ? HeuristicLab.Common.Resources.VS2008ImageLibrary.Nothing : item.ItemImage;
       listViewItem.ImageIndex = -1;
       listViewItem.ImageIndex = i;
     }
     private void UpdateListViewItemText(ListViewItem listViewItem) {
-      if (!listViewItem.Text.Equals(listViewItem.Tag.ToString()))
-        listViewItem.Text = listViewItem.Tag.ToString();
-    }
-    private IEnumerable<ListViewItem> GetListViewItemsForItem(IRun run) {
-      return runListViewItemMapping[run];
+      IRun item = listViewItem.Tag as IRun;
+      listViewItem.Text = item == null ? "null" : item.ToString();
+      listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
+    }
+    private IEnumerable<ListViewItem> GetListViewItemsForItem(IRun item) {
+      if (item == null) {
+        List<ListViewItem> listViewItems = new List<ListViewItem>();
+        foreach (ListViewItem listViewItem in itemsListView.Items) {
+          if (listViewItem.Tag == null) listViewItems.Add(listViewItem);
+        }
+        return listViewItems;
+      } else {
+        return itemListViewItemMapping[item];
+      }
     }
 
@@ -228,9 +245,11 @@
     private void itemsListView_DoubleClick(object sender, EventArgs e) {
       if (itemsListView.SelectedItems.Count == 1) {
-        IRun item = (IRun)itemsListView.SelectedItems[0].Tag;
-        IContentView view = MainFormManager.MainForm.ShowContent(item);
-        if (view != null) {
-          view.ReadOnly = ReadOnly;
-          view.Locked = Locked;
+        IRun item = itemsListView.SelectedItems[0].Tag as IRun;
+        if (item != null) {
+          IContentView view = MainFormManager.MainForm.ShowContent(item);
+          if (view != null) {
+            view.ReadOnly = ReadOnly;
+            view.Locked = Locked;
+          }
         }
       }
@@ -239,14 +258,16 @@
       if (!Locked) {
         ListViewItem listViewItem = (ListViewItem)e.Item;
-        IRun item = (IRun)listViewItem.Tag;
-        DataObject data = new DataObject();
-        data.SetData("Type", item.GetType());
-        data.SetData("Value", item);
-        if (Content.IsReadOnly || ReadOnly) {
-          DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
-        } else {
-          DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
-          if ((result & DragDropEffects.Move) == DragDropEffects.Move)
-            Content.Remove(item);
+        IRun item = listViewItem.Tag as IRun;
+        if (item != null) {
+          DataObject data = new DataObject();
+          data.SetData("Type", item.GetType());
+          data.SetData("Value", item);
+          if (Content.IsReadOnly || ReadOnly) {
+            DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
+          } else {
+            DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
+            if ((result & DragDropEffects.Move) == DragDropEffects.Move)
+              Content.Remove(item);
+          }
         }
       }
@@ -312,5 +333,4 @@
         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded), sender, e);
       else {
-        RegisterRunEvents(e.Items);
         foreach (IRun item in e.Items)
           AddListViewItem(CreateListViewItem(item));
@@ -326,5 +346,4 @@
         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
       else {
-        DeregisterRunEvents(e.Items);
         foreach (IRun item in e.Items) {
           //remove only the first matching ListViewItem, because the IRun could be contained multiple times in the ItemCollection
@@ -332,4 +351,5 @@
           if (listViewItem != null) RemoveListViewItem(listViewItem);
         }
+        RebuildImageList();
         analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
         clearButton.Enabled = itemsListView.Items.Count > 0 && !Content.IsReadOnly && !ReadOnly;
@@ -341,10 +361,10 @@
         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
       else {
-        DeregisterRunEvents(e.OldItems);
         foreach (IRun item in e.OldItems) {
+          //remove only the first matching ListViewItem, because the IRun could be contained multiple times in the ItemCollection
           ListViewItem listViewItem = GetListViewItemsForItem(item).FirstOrDefault();
           if (listViewItem != null) RemoveListViewItem(listViewItem);
         }
-        RegisterRunEvents(e.Items);
+        RebuildImageList();
         foreach (IRun item in e.Items)
           AddListViewItem(CreateListViewItem(item));
@@ -378,7 +398,7 @@
       }
     }
-    private void Run_Changed(object sender, EventArgs e) {
-      if (InvokeRequired)
-        this.Invoke(new EventHandler(Run_Changed), sender, e);
+    private void Item_Changed(object sender, EventArgs e) {
+      if (InvokeRequired)
+        this.Invoke(new EventHandler(Item_Changed), sender, e);
       else {
         IRun run = (IRun)sender;
@@ -408,4 +428,11 @@
       }
     }
+    private void RebuildImageList() {
+      itemsListView.SmallImageList.Images.Clear();
+      foreach (ListViewItem item in itemsListView.Items) {
+        itemsListView.SmallImageList.Images.Add(((IRun)item.Tag).ItemImage);
+        item.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+      }
+    }
     #endregion
   }
Index: /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.Designer.cs	(revision 5237)
@@ -26,16 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs	(revision 5237)
@@ -53,4 +53,16 @@
     public ValueLookupParameterView() {
       InitializeComponent();
+    }
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
Index: /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs	(revision 5237)
@@ -26,16 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
@@ -120,5 +108,5 @@
       this.valueViewHost.Size = new System.Drawing.Size(374, 182);
       this.valueViewHost.TabIndex = 3;
-      this.valueViewHost.ViewType = null;   
+      this.valueViewHost.ViewType = null;
       // 
       // clearValueButton
Index: /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs	(revision 5237)
@@ -54,4 +54,16 @@
     public ValueParameterView() {
       InitializeComponent();
+    }
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
Index: /trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.Designer.cs	(revision 5237)
@@ -26,16 +26,4 @@
     /// </summary>
     private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (tsplibImportDialog != null) tsplibImportDialog.Dispose();
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
 
     #region Component Designer generated code
Index: /trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs	(revision 5236)
+++ /trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/TravelingSalesmanProblemView.cs	(revision 5237)
@@ -46,4 +46,12 @@
     public TravelingSalesmanProblemView() {
       InitializeComponent();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (tsplibImportDialog != null) tsplibImportDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
     }
 
