public SlaveChartPane CreateSlavePane(string chartName, SlaveChartPane.MasterPaneSynchronizationModeEnum masterSynchronizationMode, int height) { SlaveChartPane pane = new SlaveChartPane(); _panes.Add(pane); pane.Name = "Slave Pane[" + chartName + "]" ; pane.ChartName = chartName; pane.Dock = DockStyle.Bottom; pane.MasterPaneSynchronizationMode = masterSynchronizationMode; pane.XAxisLabelsFontBrush = null; Splitter splitter = new Splitter(); splitter.Height = 4; splitter.Dock = DockStyle.Bottom; this.Controls.Add(splitter); splitter.SendToBack(); pane.Tag = splitter; this.Controls.Add(pane); pane.SendToBack(); pane.Height = height; pane.MasterPane = MasterPane; hScrollBar.SendToBack(); vScrollBar.SendToBack(); this.toolStripDynamicObjects.SendToBack(); this.toolStripMain.SendToBack(); return pane; }
/// <summary> /// /// </summary> public void RestoreState(SerializationInfoEx info) { Clear(); lock (this) { foreach (ChartPane pane in GeneralHelper.EnumerableToList <ChartPane>(_panes)) { if (pane is SlaveChartPane) { this.RemoveSlavePane((SlaveChartPane)pane); } } this.Name = info.GetString("Name"); this.hScrollBar.Visible = info.GetBoolean("hScrollBar.Visible"); this.vScrollBar.Visible = info.GetBoolean("vScrollBar.Visible"); toolStripButtonShowScrollbars.Checked = this.hScrollBar.Visible; List <SerializationInfoEx> infos = info.GetValue <List <SerializationInfoEx> >("panesStates"); for (int i = 0; i < infos.Count; i++) { if (i == 0) { MasterPane.RestoreState(infos[0], true); } else { SlaveChartPane pane = CreateSlavePane("", SlaveChartPane.MasterPaneSynchronizationModeEnum.XAxis, 100); pane.RestoreState(infos[i], true); } } } }
public SlaveChartPane CreateSlavePane(string chartName, SlaveChartPane.MasterPaneSynchronizationModeEnum masterSynchronizationMode, int height) { SlaveChartPane pane = new SlaveChartPane(); _panes.Add(pane); pane.Name = "Slave Pane[" + chartName + "]"; pane.ChartName = chartName; pane.Dock = DockStyle.Bottom; pane.MasterPaneSynchronizationMode = masterSynchronizationMode; pane.XAxisLabelsFontBrush = null; Splitter splitter = new Splitter(); splitter.Height = 4; splitter.Dock = DockStyle.Bottom; this.Controls.Add(splitter); splitter.SendToBack(); pane.Tag = splitter; this.Controls.Add(pane); pane.SendToBack(); pane.Height = height; pane.MasterPane = MasterPane; hScrollBar.SendToBack(); vScrollBar.SendToBack(); this.toolStripDynamicObjects.SendToBack(); this.toolStripMain.SendToBack(); return(pane); }
/// <summary> /// This will not remove the main pane, since it is mandatory. /// </summary> public bool RemoveSlavePane(SlaveChartPane pane) { if (_panes.Remove(pane)) { pane.MasterPane = null; pane.Clear(true, true); this.Controls.Remove((Splitter)pane.Tag); pane.Tag = null; pane.Parent = null; return(true); } return(false); }
/// <summary> /// This will not remove the main pane, since it is mandatory. /// </summary> public bool RemoveSlavePane(SlaveChartPane pane) { if (_panes.Remove(pane)) { pane.MasterPane = null; pane.Clear(true, true); this.Controls.Remove((Splitter)pane.Tag); pane.Tag = null; pane.Parent = null; return true; } return false; }