Fixed typo
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ToolStripContainer.cs
index 1985302f3e46d926443ec7332ec2d198f502efbc..d2ead20998e9e37242fe0993348ac627960aab70 100644 (file)
@@ -47,6 +47,10 @@ namespace System.Windows.Forms
                #region Public Constructors
                public ToolStripContainer () : base ()
                {
+                       content_panel = new ToolStripContentPanel ();
+                       content_panel.Dock = DockStyle.Fill;
+                       this.Controls.Add (content_panel);
+
                        this.top_panel = new ToolStripPanel ();
                        this.top_panel.Dock = DockStyle.Top;
                        this.top_panel.Height = 0;
@@ -54,7 +58,7 @@ namespace System.Windows.Forms
 
                        this.bottom_panel = new ToolStripPanel ();
                        this.bottom_panel.Dock = DockStyle.Bottom;
-                       this.top_panel.Height = 0;
+                       this.bottom_panel.Height = 0;
                        this.Controls.Add (bottom_panel);
 
                        this.left_panel = new ToolStripPanel ();
@@ -66,45 +70,60 @@ namespace System.Windows.Forms
                        this.right_panel.Dock = DockStyle.Right;
                        this.right_panel.Width = 0;
                        this.Controls.Add (right_panel);
-
-                       content_panel = new ToolStripContentPanel ();
-                       content_panel.Dock = DockStyle.Fill;
-                       this.Controls.Add (content_panel);
-               }
+       }
                #endregion
 
                #region Public Properties
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public override bool AutoScroll {
                        get { return base.AutoScroll; }
                        set { base.AutoScroll = value; }
                }
 
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new Size AutoScrollMargin {
                        get { return base.AutoScrollMargin; }
                        set { base.AutoScrollMargin = value; }
                }
 
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new Size AutoScrollMinSize {
                        get { return base.AutoScrollMinSize; }
                        set { base.AutoScrollMinSize = value; }
                }
                
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new Color BackColor {
                        get { return base.BackColor; }
                        set { base.BackColor = value; }
                }
                
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new Image BackgroundImage {
                        get { return base.BackgroundImage; }
                        set { base.BackgroundImage = value; }
                }
+
+               [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public override ImageLayout BackgroundImageLayout {
+                       get { return base.BackgroundImageLayout; }
+                       set { base.BackgroundImageLayout = value; }
+               }
                
                [Localizable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                public ToolStripPanel BottomToolStripPanel {
                        get { return this.bottom_panel; }
                }
@@ -116,34 +135,51 @@ namespace System.Windows.Forms
                }
 
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new bool CausesValidation {
                        get { return base.CausesValidation; }
                        set { base.CausesValidation = value; }
                }
 
                [Localizable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                public ToolStripContentPanel ContentPanel {
                        get { return this.content_panel; }
                }
-               
+
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public new ContextMenuStrip ContextMenuStrip {
+                       get { return base.ContextMenuStrip; }
+                       set { base.ContextMenuStrip = value; }
+               }
+
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new ControlCollection Controls {
                        get { return base.Controls; }
                }
                
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public override Cursor Cursor {
                        get { return base.Cursor; }
                        set { base.Cursor = value; }
                }
                
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new Color ForeColor {
                        get { return base.ForeColor; }
                        set { base.ForeColor = value; }
                }
                
                [Localizable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                public ToolStripPanel LeftToolStripPanel {
                        get { return this.left_panel; }
                }
@@ -155,6 +191,7 @@ namespace System.Windows.Forms
                }
 
                [Localizable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                public ToolStripPanel RightToolStripPanel {
                        get { return this.right_panel; }
                }
@@ -166,6 +203,7 @@ namespace System.Windows.Forms
                }
        
                [Localizable (false)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                public ToolStripPanel TopToolStripPanel {
                        get { return this.top_panel; }
                }
@@ -184,9 +222,10 @@ namespace System.Windows.Forms
                #endregion
 
                #region Protected Methods
+               [EditorBrowsable (EditorBrowsableState.Advanced)]
                protected override ControlCollection CreateControlsInstance ()
                {
-                       return base.CreateControlsInstance ();
+                       return new ToolStripContainerTypedControlCollection (this);
                }
 
                protected override void OnSizeChanged (EventArgs e)
@@ -196,51 +235,69 @@ namespace System.Windows.Forms
                #endregion
 
                #region Public Events
-               static object BackgroundImageLayoutChangedEvent = new object ();
-               static object ContextMenuStripChangedEvent = new object ();
-
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new event EventHandler BackColorChanged {
                        add { base.BackColorChanged += value; }
                        remove { base.BackColorChanged -= value; }
                }
 
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new event EventHandler BackgroundImageChanged {
                        add { base.BackgroundImageChanged += value; }
                        remove { base.BackgroundImageChanged -= value; }
                }
 
                [Browsable (false)]
-               public event EventHandler BackgroundImageLayoutChanged {
-                       add { Events.AddHandler (BackgroundImageLayoutChangedEvent, value); }
-                       remove { Events.RemoveHandler (BackgroundImageLayoutChangedEvent, value); }
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               public new event EventHandler BackgroundImageLayoutChanged {
+                       add { base.BackgroundImageLayoutChanged += value; }
+                       remove { base.BackgroundImageLayoutChanged -= value; }
                }
 
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public new event EventHandler CausesValidationChanged {
                        add { base.CausesValidationChanged += value; }
                        remove { base.CausesValidationChanged -= value; }
                }
 
                [Browsable (false)]
-               public event EventHandler ContextMenuStripChanged {
-                       add { Events.AddHandler (ContextMenuStripChangedEvent, value); }
-                       remove { Events.RemoveHandler (ContextMenuStripChangedEvent, value); }
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               public new event EventHandler ContextMenuStripChanged {
+                       add { base.ContextMenuStripChanged += value; }
+                       remove { base.ContextMenuStripChanged -= value; }
                }
 
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new event EventHandler CursorChanged {
                        add { base.CursorChanged += value; }
                        remove { base.CursorChanged -= value; }
                }
 
                [Browsable (false)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                public new event EventHandler ForeColorChanged {
                        add { base.ForeColorChanged += value; }
                        remove { base.ForeColorChanged -= value; }
                }
                #endregion
+
+               #region Private Class : ToolStripContainerTypedControlCollection
+               private class ToolStripContainerTypedControlCollection : ControlCollection
+               {
+                       public ToolStripContainerTypedControlCollection (Control owner) : base (owner)
+                       {
+                       }
+               }
+               #endregion
        }
 }
 #endif