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; }
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(); }
void OnAddPanel(object sender, EventArgs e) { IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost)); StatusPanel panel = (StatusPanel)service.CreateComponent(typeof(StatusPanel)); _container.Controls.Add(panel); }
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)); }
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(); }
internal bool SetCollapsed(StatusPanel statusPanel, bool value) { return(value); }
public override void Initialize(System.ComponentModel.IComponent component) { base.Initialize(component); _panel = (StatusPanel)component; }
internal bool SetCollapsed(StatusPanel statusPanel, bool value) { return value; }