2006-12-31 Chris Toshok <toshok@ximian.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ToolStripItemCollection.cs
index 3ef1eadbf0ef6bb9150e7b76679c0b025cbc6825..48d5c5328ca560ceb33949d6fb3b1ba04d0192e8 100644 (file)
@@ -54,7 +54,7 @@ namespace System.Windows.Forms
                #region Public Properties
                public override bool IsReadOnly { get { return base.IsReadOnly; } }
                
-               public virtual ToolStripItem this[int index] { get { return (ToolStripItem)base[index]; } }
+               public new virtual ToolStripItem this[int index] { get { return (ToolStripItem)base[index]; } }
                
                public virtual ToolStripItem this[string key] {
                        get {
@@ -89,9 +89,12 @@ namespace System.Windows.Forms
 
                        value.Owner = owner;
                        value.Parent = owner;
+                       
+                       int index = base.Add (value);
+                       
                        owner.PerformLayout ();
                        owner.OnItemAdded (new ToolStripItemEventArgs (value));
-                       return base.Add (value);
+                       return index;
                }
 
                public ToolStripItem Add (string text, Image image)
@@ -138,7 +141,7 @@ namespace System.Windows.Forms
                        this.owner.ResumeLayout ();
                }
 
-               public virtual void Clear ()
+               public new virtual void Clear ()
                {
                        if (this.IsReadOnly)
                                throw new NotSupportedException ("This collection is read-only");
@@ -218,7 +221,7 @@ namespace System.Windows.Forms
                        owner.PerformLayout ();
                }
 
-               public void RemoveAt (int index)
+               public new void RemoveAt (int index)
                {
                        if (this.IsReadOnly)
                                throw new NotSupportedException ("This collection is read-only");
@@ -294,4 +297,4 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif
\ No newline at end of file
+#endif