public void RegisterFrontControl(UserControl control, PluginPosition position) { if (this._owner.InvokeRequired) { this._owner.Invoke((MethodInvoker) delegate { this._owner.RegisterFrontControl(control, position); }); } else { this._owner.RegisterFrontControl(control, position); } }
public void RegisterFrontControl(UserControl c, PluginPosition position) { SizeType sizeType1 = c.Visible ? SizeType.Absolute : SizeType.AutoSize; SizeType sizeType2 = c.Visible ? SizeType.Percent : SizeType.AutoSize; switch (position) { case PluginPosition.Top: if (this.topPluginPanel.Controls.Count > 0) { ++this.topPluginPanel.ColumnCount; this.topPluginPanel.ColumnStyles.Add(new ColumnStyle(sizeType1, 4f)); ++this.topPluginPanel.ColumnCount; this.topPluginPanel.ColumnStyles.Add(new ColumnStyle(sizeType2, 100f)); } else this.topPluginPanel.ColumnStyles[0].SizeType = sizeType2; this._oldTopSplitterPosition = Math.Max(this._oldTopSplitterPosition, c.Height); this.topPluginPanel.Controls.Add((Control) c, this.topPluginPanel.ColumnCount - 1, 0); break; case PluginPosition.Bottom: if (this.bottomPluginPanel.Controls.Count > 0) { ++this.bottomPluginPanel.ColumnCount; this.bottomPluginPanel.ColumnStyles.Add(new ColumnStyle(sizeType1, 4f)); ++this.bottomPluginPanel.ColumnCount; this.bottomPluginPanel.ColumnStyles.Add(new ColumnStyle(sizeType2, 100f)); } else this.bottomPluginPanel.ColumnStyles[0].SizeType = sizeType2; this._oldBottomSplitterPosition = Math.Max(this._oldBottomSplitterPosition, c.Height); this.bottomPluginPanel.Controls.Add((Control) c, this.bottomPluginPanel.ColumnCount - 1, 0); break; case PluginPosition.Left: if (this.leftPluginPanel.Controls.Count > 0) { ++this.leftPluginPanel.RowCount; this.leftPluginPanel.RowStyles.Add(new RowStyle(sizeType1, 4f)); ++this.leftPluginPanel.RowCount; this.leftPluginPanel.RowStyles.Add(new RowStyle(sizeType2, 100f)); } else this.leftPluginPanel.RowStyles[0].SizeType = sizeType2; this._oldLeftSplitterPosition = Math.Max(this._oldLeftSplitterPosition, c.Width); this.leftPluginPanel.Controls.Add((Control) c, 0, this.leftPluginPanel.RowCount - 1); break; case PluginPosition.Right: if (this.rightPluginPanel.Controls.Count > 0) { ++this.rightPluginPanel.RowCount; this.rightPluginPanel.RowStyles.Add(new RowStyle(sizeType1, 4f)); ++this.rightPluginPanel.RowCount; this.rightPluginPanel.RowStyles.Add(new RowStyle(sizeType2, 100f)); } else this.rightPluginPanel.RowStyles[0].SizeType = sizeType2; this._oldRightSplitterPosition = Math.Max(this._oldRightSplitterPosition, c.Width); this.rightPluginPanel.Controls.Add((Control) c, 0, this.rightPluginPanel.RowCount - 1); break; } c.Margin = new Padding(0); c.Dock = DockStyle.Fill; c.VisibleChanged += new EventHandler(this.plugin_VisibleChanged); this.plugin_VisibleChanged((object) c, (EventArgs) null); }
public void RegisterFrontControl(UserControl control, PluginPosition position) { if (this._owner.InvokeRequired) this._owner.Invoke((Delegate) (() => this._owner.RegisterFrontControl(control, position))); else this._owner.RegisterFrontControl(control, position); }