示例#1
0
            public override void Add(Control value)
            {
                StatusPanel sp = value as StatusPanel;

                if (sp == null)
                {
                    throw new ArgumentException("Not a status panel", "value");
                }

                if (!_owner.InsertingItem())
                {
                    _owner.DoAddPanel(value);
                }

                base.Add(value);

                ISite site = _owner.Site;

                if (site != null && site.Container != null)
                {
                    site.Container.Add(value);
                }

                _owner.ApplySizes(sp);
                sp.Owner = _owner;
            }
示例#2
0
        internal void ApplySizes(StatusPanel first)
        {
            int  i      = 0;
            Size clSize = ClientSize;

            foreach (StatusPanel panel in Controls)
            {
                if (first != null && first != panel)
                {
                    continue;
                }
                else
                {
                    first = null;
                }

                if (!panel.Visible)
                {
                    continue;
                }

                panel.PanelLocation = new Point(0, i);
                int height = panel.PanelSize.Height;
                panel.PanelSize = new Size(clSize.Width - 2, height);

                i += height + 1 + PanelSpace;
            }

            this.AutoScrollMinSize = new Size(Width - SystemInformation.VerticalScrollBarWidth - 2, i + 1);
            Invalidate();
        }
示例#3
0
        void OnAddPanel(object sender, EventArgs e)
        {
            IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost));

            StatusPanel panel = (StatusPanel)service.CreateComponent(typeof(StatusPanel));

            _container.Controls.Add(panel);
        }
示例#4
0
        public override ControlDesigner InternalControlDesigner(int internalControlIndex)
        {
            if (internalControlIndex < 0 || internalControlIndex >= _container.Controls.Count)
            {
                throw new ArgumentOutOfRangeException();
            }

            StatusPanel panel = _container.Controls[internalControlIndex] as StatusPanel;

            return((ControlDesigner)_designerHost.GetDesigner(panel));
        }
示例#5
0
        internal void ApplySizes(StatusPanel first)
        {
            int i = 0;
            Size clSize = ClientSize;
            foreach (StatusPanel panel in Controls)
            {
                if (first != null && first != panel)
                    continue;
                else
                    first = null;

                if (!panel.Visible)
                    continue;

                panel.PanelLocation = new Point(0, i);
                int height = panel.PanelSize.Height;
                panel.PanelSize = new Size(clSize.Width - 2, height);

                i += height + 1 + PanelSpace;
            }

            this.AutoScrollMinSize = new Size(Width - SystemInformation.VerticalScrollBarWidth - 2, i + 1);
            Invalidate();
        }
示例#6
0
 internal bool SetCollapsed(StatusPanel statusPanel, bool value)
 {
     return(value);
 }
示例#7
0
        public override void Initialize(System.ComponentModel.IComponent component)
        {
            base.Initialize(component);

            _panel = (StatusPanel)component;
        }
示例#8
0
 internal bool SetCollapsed(StatusPanel statusPanel, bool value)
 {
     return value;
 }
示例#9
0
        public override void Initialize(System.ComponentModel.IComponent component)
        {
            base.Initialize(component);

            _panel = (StatusPanel)component;
        }