private void OnFormShown(object sender, EventArgs e) { WizardPageBase firstPage = this.SelectedPage; if (firstPage != null) { firstPage.OnBeforeDisplay(EventArgs.Empty); firstPage.OnAfterDisplay(EventArgs.Empty); } }
public virtual void GoNext() { //thread safe call if (this.InvokeRequired) { VoidCallback callback = new VoidCallback(GoNext); this.Invoke(callback); } else { if (this.SelectedPage != null) { this.disabled = true; this.RedrawButtons(); this.Cursor = Cursors.WaitCursor; try { WizardPageBase selectedPage = this.SelectedPage; CancelEventArgs args = new CancelEventArgs(); selectedPage.OnBeforeMoveNext(args); if (!args.Cancel) { if (selectedPage.NextPage == null) { this.OnFinish(EventArgs.Empty); } else { WizardPageBase nextPage = selectedPage.NextPage; if (nextPage != null) { nextPage.OnBeforeDisplay(EventArgs.Empty); } this.SelectedPage = nextPage; if (nextPage != null) { nextPage.OnAfterDisplay(EventArgs.Empty); } } } } finally { this.disabled = false; this.RedrawButtons(); this.Cursor = Cursors.Default; } } } }
private WizardPageBase[] GetConnectedPages(WizardPageBase currentPage, bool forwardDirection) { ArrayList list = new ArrayList(); foreach (Control ctrl in base.Controls) { if (ctrl is WizardPageBase) { WizardPageBase page = (WizardPageBase)ctrl; if (((page.NextPage == currentPage) && forwardDirection) || ((page.PreviousPage == currentPage) && !forwardDirection)) { list.Add(page); } } } return((WizardPageBase[])list.ToArray(typeof(WizardPageBase))); }
public void LinkPages() { WizardPageBase prevPage = null; foreach (Control ctrl in this.Controls) { WizardPageBase page = ctrl as WizardPageBase; if (page != null) { page.PreviousPage = prevPage; if (prevPage != null) { prevPage.NextPage = page; } prevPage = page; } } }
public virtual void GoBack() { //thread safe call if (this.InvokeRequired) { VoidCallback callback = new VoidCallback(GoBack); this.Invoke(callback); } else { this.disabled = true; this.RedrawButtons(); this.Cursor = Cursors.WaitCursor; try { WizardPageBase selectedPage = this.SelectedPage; CancelEventArgs args = new CancelEventArgs(); selectedPage.OnBeforeMoveBack(args); if (!args.Cancel) { WizardPageBase prevPage = selectedPage.PreviousPage; this.SelectedPage = prevPage; if (prevPage != null) { prevPage.OnAfterDisplay(EventArgs.Empty); } } } finally { this.disabled = false; this.RedrawButtons(); this.Cursor = Cursors.Default; } } }
public void SetPagePair(WizardPageBase firstPage, WizardPageBase secondPage) { firstPage.NextPage = secondPage; secondPage.PreviousPage = firstPage; }
public WizardPageBase[] GetPagesWithPreviousPage(WizardPageBase previousPage) { return this.GetConnectedPages(previousPage, false); }
public WizardPageBase[] GetPagesWithNextPage(WizardPageBase nextPage) { return this.GetConnectedPages(nextPage, true); }
private WizardPageBase[] GetConnectedPages(WizardPageBase currentPage, bool forwardDirection) { ArrayList list = new ArrayList(); foreach (Control ctrl in base.Controls) { if (ctrl is WizardPageBase) { WizardPageBase page = (WizardPageBase) ctrl; if (((page.NextPage == currentPage) && forwardDirection) || ((page.PreviousPage == currentPage) && !forwardDirection)) { list.Add(page); } } } return (WizardPageBase[]) list.ToArray(typeof(WizardPageBase)); }
public WizardPageBase[] GetPagesWithPreviousPage(WizardPageBase previousPage) { return(this.GetConnectedPages(previousPage, false)); }
public WizardPageBase[] GetPagesWithNextPage(WizardPageBase nextPage) { return(this.GetConnectedPages(nextPage, true)); }