diff options
author | Chris Toshok <toshok@novell.com> | 2007-01-23 23:05:56 +0300 |
---|---|---|
committer | Chris Toshok <toshok@novell.com> | 2007-01-23 23:05:56 +0300 |
commit | 90edb1d909f2c65491a0e0eb370692dddde137ff (patch) | |
tree | 168c6bcf93f2b9d16b85db6fac4bebf2e69d2f66 | |
parent | 60dfeb46f3bbf305c946c0fc68570260187bc03f (diff) |
* Control.cs: ControlCollection seems to have super-secret
abstraction breaking knowledge of Mdi containers. allow MdiClient
to add toplevel controls.
2007-01-23 Chris Toshok <toshok@ximian.com>
svn path=/trunk/mcs/; revision=71554
-rw-r--r-- | mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index ef3e7edfc01..9a6f23a64ef 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,5 +1,11 @@ 2007-01-23 Chris Toshok <toshok@ximian.com> + * Control.cs: ControlCollection seems to have super-secret + abstraction breaking knowledge of Mdi containers. allow MdiClient + to add toplevel controls. + +2007-01-23 Chris Toshok <toshok@ximian.com> + * Control.cs: throw an ArgumentException if a toplevel control is added to our control collection from ControlCollection.Add, as well as from ControlCollection.IList.Add. This fixes the diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs index ee52b60f965..6c8e73c56a8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs @@ -467,7 +467,7 @@ namespace System.Windows.Forms if (value == null) return; - if (((Control)value).GetTopLevel()) { + if (((Control)value).GetTopLevel() && !(owner is MdiClient)) { throw new ArgumentException("Cannot add a top level control to a control.", "value"); } @@ -884,7 +884,7 @@ namespace System.Windows.Forms throw new ArgumentException("value", "Cannot add null controls"); } - if (((Control)value).GetTopLevel()) { + if (((Control)value).GetTopLevel() && !(owner is MdiClient)) { throw new ArgumentException("Cannot add a top level control to a control.", "value"); } |