Index: /branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs
===================================================================
--- /branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs	(revision 12199)
+++ /branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs	(revision 12200)
@@ -29,4 +29,6 @@
 namespace HeuristicLab.Optimizer {
   internal partial class NewItemDialog : Form {
+    private bool isInitialized;
+
     private List<TreeNode> treeNodes;
     private string currentSearchString;
@@ -58,4 +60,6 @@
 
     private void NewItemDialog_Load(object sender, EventArgs e) {
+      if (isInitialized) return;
+
       var categories =
         from t in ApplicationManager.Manager.GetTypes(typeof(IItem))
@@ -68,5 +72,5 @@
       imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Namespace);  // plugins
       imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Interface);  // interfacesitemsListView.SmallImageList = new ImageList();
-      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Template);   // generic typesitemsListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Class);  // default icon
+      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Template);   // generic types
 
       foreach (var category in categories) {
@@ -105,6 +109,5 @@
       foreach (var node in treeNodes)
         typesTreeView.Nodes.Add((TreeNode)node.Clone());
-      //for (int i = 0; i < itemsListView.Columns.Count; i++)
-      //  itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
+      isInitialized = true;
     }
 
@@ -128,41 +131,42 @@
           RestoreSelectedNode(selectedNode);
           typesTreeView.EndUpdate();
-          // remove nodes
-          typesTreeView.BeginUpdate();
-          int i = 0;
-          while (i < typesTreeView.Nodes.Count) {
-            int j = 0;
-            while (j < typesTreeView.Nodes[i].Nodes.Count) {
-              if (!typesTreeView.Nodes[i].Nodes[j].Text.ToLower().Contains(searchString)) {
-                if ((typesTreeView.Nodes[i].Nodes[j].Tag as Type).Equals(SelectedType))
-                  SelectedType = null;
-                typesTreeView.Nodes[i].Nodes[j].Remove();
-              } else
-                j++;
-            }
-            if (typesTreeView.Nodes[i].Nodes.Count == 0)
-              typesTreeView.Nodes[i].Remove();
-            else
-              i++;
-          }
-          typesTreeView.EndUpdate();
-          currentSearchString = searchString;
-
-          // if there is just one type node left, select by default
-          if (typesTreeView.Nodes.Count == 1) {
-            if (typesTreeView.Nodes[0].Nodes.Count == 1) {
-              typesTreeView.SelectedNode = typesTreeView.Nodes[0].Nodes[0];
-            }
-          }
-
-          if (typesTreeView.Nodes.Count == 0) {
-            SelectedType = null;
-            typesTreeView.Enabled = false;
-          } else {
-            SetTreeNodeVisibility();
-            typesTreeView.Enabled = true;
-          }
-          UpdateDescription();
-        }
+        }
+
+        // remove nodes
+        typesTreeView.BeginUpdate();
+        int i = 0;
+        while (i < typesTreeView.Nodes.Count) {
+          int j = 0;
+          while (j < typesTreeView.Nodes[i].Nodes.Count) {
+            if (!typesTreeView.Nodes[i].Nodes[j].Text.ToLower().Contains(searchString)) {
+              if ((typesTreeView.Nodes[i].Nodes[j].Tag as Type).Equals(SelectedType))
+                SelectedType = null;
+              typesTreeView.Nodes[i].Nodes[j].Remove();
+            } else
+              j++;
+          }
+          if (typesTreeView.Nodes[i].Nodes.Count == 0)
+            typesTreeView.Nodes[i].Remove();
+          else
+            i++;
+        }
+        typesTreeView.EndUpdate();
+        currentSearchString = searchString;
+
+        // if there is just one type node left, select by default
+        if (typesTreeView.Nodes.Count == 1) {
+          if (typesTreeView.Nodes[0].Nodes.Count == 1) {
+            typesTreeView.SelectedNode = typesTreeView.Nodes[0].Nodes[0];
+          }
+        }
+
+        if (typesTreeView.Nodes.Count == 0) {
+          SelectedType = null;
+          typesTreeView.Enabled = false;
+        } else {
+          SetTreeNodeVisibility();
+          typesTreeView.Enabled = true;
+        }
+        UpdateDescription();
       }
     }
