Пример #1
0
            public ControlCollection(Control owner)
                : base(owner)
            {
                if (owner == null)
                {
                    throw new ArgumentNullException("owner", "Tried to create a MultiPanelPage.ControlCollection with a null owner.");
                }

                MultiPanelPage _c = owner as MultiPanelPage;

                if (_c == null)
                {
                    throw new ArgumentException("Tried to create a MultiPanelPage.ControlCollection with a non-MultiPanelPage owner.", "owner");
                }
            }
Пример #2
0
            public override void Add(Control value)
            {
                if (value == null)
                {
                    throw new ArgumentNullException("value", "Tried to add a null value to the MultiPanelPage.ControlCollection.");
                }

                MultiPanelPage _p = value as MultiPanelPage;

                if (_p != null)
                {
                    throw new ArgumentException("Tried to add a MultiPanelPage control to the MultiPanelPage.ControlCollection.", "value");
                }

                base.Add(value);
            }
Пример #3
0
        public override void Add(Control value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value", "Tried to add a null value to the MultiPanelPagesCollection.");
            }

            MultiPanelPage _p = value as MultiPanelPage;

            if (_p == null)
            {
                throw new ArgumentException("Tried to add a non-MultiPanelPage control to the MultiPanelPagesCollection", "value");
            }

            _p.SendToBack();

            base.Add(_p);
        }