Remove ChangeLog files from the repo
[mono.git] / mcs / class / System.Design / System.ComponentModel.Design / CollectionEditor.cs
index 79d050555ebb85e657e98e0d237be430bd349578..899edd63830213fc7a0e3a333d8f177859a462bb 100644 (file)
@@ -382,14 +382,10 @@ namespace System.ComponentModel.Design
                                this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                                this.ResumeLayout (false);
 
-#if NET_2_0
                                if (editor.CollectionType.IsGenericType)
                                        this.Text = editor.CollectionItemType.Name + " Collection Editor";
                                else
                                        this.Text = editor.CollectionType.Name + " Collection Editor";
-#else
-                               this.Text = editor.CollectionType.Name + " Collection Editor";
-#endif
                                foreach (Type type in editor.NewItemTypes)
                                        addType.Items.Add (type.Name);
                                if (addType.Items.Count > 0)
@@ -541,13 +537,8 @@ namespace System.ComponentModel.Design
                                        for (int i = selected.Length - 1; i >= 0; i--)
                                                itemsList.Items.RemoveAt (selected[i]);
 
-                                       int prevIndex = --selected[0];
-                                       if (prevIndex == -1 && itemsList.Items.Count > 0)
-                                               prevIndex = 0;
-                                       itemsList.SelectedIndex = prevIndex;
+                                       itemsList.SelectedIndex = Math.Min (selected[0], itemsList.Items.Count-1);
                                }
-                               if (itemsList.SelectedItems.Count == 0)
-                                       itemDisplay.SelectedObject = null;
                        }
 
                        // OnEditValueChanged is called only if the  EditValue has changed,
@@ -637,11 +628,7 @@ namespace System.ComponentModel.Design
                        }
 
                        if (instance == null) {
-#if NET_2_0
                                instance = TypeDescriptor.CreateInstance (provider, itemType, null, null);
-#else
-                               instance =  Activator.CreateInstance (itemType);
-#endif
                        }
                        return instance;
                }