Index: stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
===================================================================
--- stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs	(revision 15109)
+++ stable/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs	(revision 15115)
@@ -52,11 +52,14 @@
     }
 
-    public ListView ItemsListView {
-      get { return itemsListView; }
-    }
+    private int EmptyImageIndex { get { return 0; } }
+    private int RunImageIndex { get { return 1; } }
 
     public RunCollectionView() {
       InitializeComponent();
-      itemsGroupBox.Text = "Runs";
+      UpdateGroupBoxText();
+
+      itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Nothing);
+      itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Class);
+
       itemListViewItemMapping = new Dictionary<IRun, List<ListViewItem>>();
       runCollectionModifiersListView.Evaluator = EvaluateModifications;
@@ -83,10 +86,8 @@
     }
     private void DeregisterItemEvents(IRun item) {
-      item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
       item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
       item.PropertyChanged -= Item_PropertyChanged;
     }
     private void RegisterItemEvents(IRun item) {
-      item.ItemImageChanged += new EventHandler(Item_ItemImageChanged);
       item.ToStringChanged += new EventHandler(Item_ToStringChanged);
       item.PropertyChanged += Item_PropertyChanged;
@@ -116,6 +117,7 @@
       itemsListView.Items.Clear();
       itemListViewItemMapping.Clear();
-      RebuildImageList();
       viewHost.Content = null;
+
+      UpdateGroupBoxText();
 
       if (Content != null) {
@@ -129,10 +131,16 @@
           runCollectionModifiersListView.Content = RunCollection.Modifiers;
         }
+
+        ListViewItem[] items = new ListViewItem[Content.Count];
+        int count = 0;
         foreach (IRun item in Content) {
           ListViewItem listViewItem = CreateListViewItem(item);
-          AddListViewItem(listViewItem);
+
           if ((selectedName != null) && item.Name.Equals(selectedName))
             listViewItem.Selected = true;
-        }
+          items[count] = listViewItem;
+          count++;
+        }
+        itemsListView.Items.AddRange(items);
         AdjustListViewColumnSizes();
       } else {
@@ -166,39 +174,36 @@
     }
 
-    private ListViewItem CreateListViewItem(IRun item) {
+    private static readonly string tooltipText = ItemAttribute.GetName(typeof(Run)) + ": " +
+                                    ItemAttribute.GetDescription(typeof(Run));
+    private ListViewItem CreateListViewItem(IRun run) {
       ListViewItem listViewItem = new ListViewItem();
-      if (item == null) {
+      if (run == null) {
         listViewItem.Text = "null";
-        itemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Nothing);
-        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
+        listViewItem.ImageIndex = EmptyImageIndex;
+        return listViewItem;
+      }
+
+      listViewItem.Text = run.Name;
+      listViewItem.ToolTipText = tooltipText;
+      listViewItem.ImageIndex = RunImageIndex;
+      listViewItem.Tag = run;
+
+      if (run.Visible) {
+        listViewItem.Font = new Font(listViewItem.Font, FontStyle.Regular);
+        listViewItem.ForeColor = run.Color;
       } 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;
-
-        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;
-        }
-      }
+        listViewItem.Font = new Font(listViewItem.Font, FontStyle.Italic);
+        listViewItem.ForeColor = Color.LightGray;
+      }
+
+      if (!itemListViewItemMapping.ContainsKey(run)) {
+        itemListViewItemMapping.Add(run, new List<ListViewItem>());
+        RegisterItemEvents(run);
+      }
+      itemListViewItemMapping[run].Add(listViewItem);
+
       return listViewItem;
     }
-    private void AddListViewItem(ListViewItem listViewItem) {
-      if (listViewItem == null) throw new ArgumentNullException();
-      itemsListView.Items.Add(listViewItem);
-      IRun run = listViewItem.Tag as IRun;
-      if (run != null) {
-        if (!itemListViewItemMapping.ContainsKey(run)) {
-          itemListViewItemMapping.Add(run, new List<ListViewItem>());
-          RegisterItemEvents(run);
-        }
-        itemListViewItemMapping[run].Add(listViewItem);
-      }
-    }
+
     private void RemoveListViewItem(ListViewItem listViewItem) {
       if (listViewItem == null) throw new ArgumentNullException();
@@ -213,12 +218,5 @@
       listViewItem.Remove();
     }
-    private void UpdateListViewItemImage(ListViewItem listViewItem) {
-      if (listViewItem == null) throw new ArgumentNullException();
-      IRun item = listViewItem.Tag as IRun;
-      int i = listViewItem.ImageIndex;
-      itemsListView.SmallImageList.Images[i] = item == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : item.ItemImage;
-      listViewItem.ImageIndex = -1;
-      listViewItem.ImageIndex = i;
-    }
+
     private void UpdateListViewItemText(ListViewItem listViewItem) {
       if (listViewItem == null) throw new ArgumentNullException();
@@ -239,4 +237,9 @@
         return listViewItems == null ? Enumerable.Empty<ListViewItem>() : listViewItems;
       }
+    }
+
+    private void UpdateGroupBoxText() {
+      if (Content == null || Content.Count == 0) itemsGroupBox.Text = "Runs";
+      else itemsGroupBox.Text = @"Runs (" + Content.Count + @")";
     }
 
@@ -393,5 +396,6 @@
         RunCollection.UpdateOfRunsInProgress = true;
         RunCollection.Modify();
-      } finally {
+      }
+      finally {
         ReadOnly = false;
         RunCollection.UpdateOfRunsInProgress = false;
@@ -406,11 +410,11 @@
         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded), sender, e);
       else {
-        foreach (IRun item in e.Items)
-          AddListViewItem(CreateListViewItem(item));
-
+        var items = e.Items.Select(CreateListViewItem).ToArray();
+        itemsListView.Items.AddRange(items);
         AdjustListViewColumnSizes();
         analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
         clearButton.Enabled = itemsListView.Items.Count > 0 && !Content.IsReadOnly && !ReadOnly;
         runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
+        UpdateGroupBoxText();
       }
     }
@@ -425,8 +429,8 @@
           if (listViewItem != null) RemoveListViewItem(listViewItem);
         }
-        RebuildImageList();
         analyzeRunsToolStripDropDownButton.Enabled = itemsListView.Items.Count > 0;
         clearButton.Enabled = itemsListView.Items.Count > 0 && !Content.IsReadOnly && !ReadOnly;
         runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
+        UpdateGroupBoxText();
       }
     }
@@ -441,7 +445,6 @@
           if (listViewItem != null) RemoveListViewItem(listViewItem);
         }
-        RebuildImageList();
-        foreach (IRun item in e.Items)
-          AddListViewItem(CreateListViewItem(item));
+        var items = e.Items.Select(CreateListViewItem).ToArray();
+        itemsListView.Items.AddRange(items);
 
         AdjustListViewColumnSizes();
@@ -449,4 +452,5 @@
         clearButton.Enabled = itemsListView.Items.Count > 0 && !Content.IsReadOnly && !ReadOnly;
         runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
+        UpdateGroupBoxText();
       }
     }
@@ -456,12 +460,11 @@
         suppressUpdates = RunCollection.UpdateOfRunsInProgress;
         if (!suppressUpdates) {
-          foreach (IRun item in Content) {
-            //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);
+          foreach (IRun run in Content) {
+            DeregisterItemEvents(run);
           }
-          RebuildImageList();
-          foreach (IRun item in Content)
-            AddListViewItem(CreateListViewItem(item));
+          itemsListView.Items.Clear();
+          itemListViewItemMapping.Clear();
+          var items = Content.Select(CreateListViewItem).ToArray();
+          itemsListView.Items.AddRange(items);
 
           AdjustListViewColumnSizes();
@@ -469,4 +472,5 @@
           clearButton.Enabled = itemsListView.Items.Count > 0 && !Content.IsReadOnly && !ReadOnly;
           runCollectionConstraintCollectionView.ReadOnly = itemsListView.Items.Count == 0;
+          UpdateGroupBoxText();
         }
       }
@@ -475,14 +479,4 @@
 
     #region Item Events
-    private void Item_ItemImageChanged(object sender, EventArgs e) {
-      if (suppressUpdates) return;
-      if (InvokeRequired)
-        Invoke(new EventHandler(Item_ItemImageChanged), sender, e);
-      else {
-        IRun item = (IRun)sender;
-        foreach (ListViewItem listViewItem in GetListViewItemsForItem(item))
-          UpdateListViewItemImage(listViewItem);
-      }
-    }
     private void Item_ToStringChanged(object sender, EventArgs e) {
       if (suppressUpdates) return;
@@ -528,12 +522,4 @@
       }
     }
-    private void RebuildImageList() {
-      itemsListView.SmallImageList.Images.Clear();
-      foreach (ListViewItem listViewItem in itemsListView.Items) {
-        IRun item = listViewItem.Tag as IRun;
-        itemsListView.SmallImageList.Images.Add(item == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : item.ItemImage);
-        listViewItem.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
-      }
-    }
     #endregion
   }
