private void ShowNextPage() { target.SendUpdateTab(this); if (currentPageIndex >= (Target.Pages.Count - 1)) { return; } int checkPageIndex = currentPageIndex + 1; bool foundVisiblePage = false; while (!(checkPageIndex >= (Target.Pages.Count - 1))) { if (Target.Pages[checkPageIndex].Visible) { foundVisiblePage = true; break; } checkPageIndex++; } if (!foundVisiblePage) { return; } if (currentPage != null) { if (!currentPage.Save()) { return; } this.Controls.Remove(currentPage); currentPage.Dispose(); } currentPageIndex = checkPageIndex; PropPage page = (PropPage)Activator.CreateInstance(Target.Pages[currentPageIndex].Page); page.Top = this.Contents.Top; page.Left = this.Contents.Left; page.Binding = target; StepTitle.Text = Target.Pages[currentPageIndex].Title; page.SetData(Target.Data); this.Controls.Add(page); currentPage = page; UpdateButtonStates(); }
private void ShowTab(WizPropPageElement element) { if (currentPage != null) { currentPage.Save(); this.Controls.Remove(currentPage); currentPage.Dispose(); } PropPage page = (PropPage)Activator.CreateInstance(element.Page); page.Top = this.Contents.Top; page.Left = this.Contents.Left; page.Binding = target; page.SetData(Target.Data); this.Controls.Add(page); currentPage = page; UpdateButtonStates(); }
private void ShowNextPage() { target.SendUpdateTab(this); if (currentPageIndex >= (Target.Pages.Count-1)) { return; } var checkPageIndex = currentPageIndex+1; var foundVisiblePage = false; while (!(checkPageIndex >= (Target.Pages.Count - 1))) { if (Target.Pages[checkPageIndex].Visible) { foundVisiblePage = true; break; } checkPageIndex++; } if (!foundVisiblePage) { return; } if (currentPage != null) { if (!currentPage.Save()) { return; } Controls.Remove(currentPage); currentPage.Dispose(); } currentPageIndex = checkPageIndex; var page = (PropPage)Activator.CreateInstance(Target.Pages[currentPageIndex].Page); page.Top = Contents.Top; page.Left = Contents.Left; page.Binding = target; StepTitle.Text = Target.Pages[currentPageIndex].Title; page.SetData(Target.Data); Controls.Add(page); currentPage = page; UpdateButtonStates(); }
private void ShowPreviousPage() { target.SendUpdateTab(this); if (currentPageIndex < 1 ) { return; } int checkPageIndex = currentPageIndex - 1; bool foundVisiblePage = false; while (checkPageIndex >= 0) { if (Target.Pages[checkPageIndex].Visible) { foundVisiblePage = true; break; } checkPageIndex--; } if (!foundVisiblePage) { return; } if (currentPage != null) { if (!currentPage.Save()) { return; } this.Controls.Remove(currentPage); currentPage.Dispose(); } currentPageIndex = checkPageIndex; PropPage page = (PropPage)Activator.CreateInstance(Target.Pages[currentPageIndex].Page); page.Top = this.Contents.Top; page.Left = this.Contents.Left; page.Binding = target; StepTitle.Text = Target.Pages[currentPageIndex].Title; page.SetData(Target.Data); this.Controls.Add(page); currentPage = page; UpdateButtonStates(); }