public void AddPage(CWizardPanel aPanel) { if (_Panels.IndexOf(aPanel) < 0) { _Panels.Add(aPanel); aPanel.HostDialog = this; } }
public void SwapPage(int aPageNo) { aPageNo = aPageNo >= 0 ? (aPageNo < _Panels.Count ? aPageNo : _Panels.Count - 1) : 0; CWizardPanel lNewPanel = _Panels.Count == 0 ? null : (CWizardPanel)(_Panels[aPageNo]); if (_CurrentPage == lNewPanel) { return; } if (lNewPanel != null) { this.SuspendLayout(); lNewPanel.Location = new Point(0, this.CustomAreaTop); lNewPanel.Size = new Size(this.ClientRectangle.Width, this.CustomAreaBottom - this.CustomAreaTop); this.Controls.Add(lNewPanel); if (_CurrentPage != null) { this.Controls.Remove(_CurrentPage); } this.ResumeLayout(); } _CurrentPage = lNewPanel; bOk.Visible = _Panels.IndexOf(_CurrentPage) + 1 == _Panels.Count; _bNext.Visible = _Panels.IndexOf(_CurrentPage) + 1 != _Panels.Count; _bPrev.Visible = _Panels.IndexOf(_CurrentPage) != 0; lTitle.Text = buildTitle(null); _bNext.Enabled = false; bOk.Enabled = false; if (_CurrentPage != null) { _CurrentPage.DoPageShow(); _bNext.Enabled = _bNext.Enabled || _CurrentPage.AllwaysOk; bOk.Enabled = bOk.Enabled || _CurrentPage.AllwaysOk; } }