/// <Summary> /// PreviousPage runs when the Back Button is clicked and raises a PreviousPage /// Event /// </Summary> private void PreviousPage(object sender, CommandEventArgs e) { if (CurrentPage > 0) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage--; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }
/// <Summary> /// NextPage runs when the Next Button is clicked and raises a NextPage Event /// </Summary> private void NextPage(object sender, CommandEventArgs e) { //If we are not on the last page Create a New WizardEventArgs Object //and trigger a Previous Page Event if (CurrentPage < Pages.Count - 1) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage++; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }
/// <Summary> /// PreviousPage runs when the Back Button is clicked and raises a PreviousPage /// Event /// </Summary> private void PreviousPage( object sender, CommandEventArgs e ) { if (CurrentPage > 0) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage--; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }
protected virtual void OnFinishWizard(WizardEventArgs e) { //Invokes the delegates. if (FinishWizardEvent != null) { FinishWizardEvent(this, e); } }
protected virtual void OnAfterPageChanged(WizardEventArgs e) { //Invokes the delegates. if (AfterPageChangedEvent != null) { AfterPageChangedEvent(this, e); } }
/// <Summary> /// NextPage runs when the Next Button is clicked and raises a NextPage Event /// </Summary> private void NextPage( object sender, CommandEventArgs e ) { //If we are not on the last page Create a New WizardEventArgs Object //and trigger a Previous Page Event if (CurrentPage < Pages.Count - 1) { int PrevPage = CurrentPage; WizardCancelEventArgs wce = new WizardCancelEventArgs(CurrentPage, PrevPage, Pages); OnBeforePageChanged(wce); if (wce.Cancel == false) { //Event Not Cancelled by Event Consumer CurrentPage++; WizardEventArgs we = new WizardEventArgs(CurrentPage, PrevPage, Pages); OnAfterPageChanged(we); } } DisplayCurrentPage(); }
/// <Summary> /// Finish runs when the Back Button is clicked and raises a FinishWizard Event /// </Summary> private void Finish( object sender, CommandEventArgs e ) { //Create a New WizardEventArgs Object and trigger a Finish Event WizardEventArgs we = new WizardEventArgs(CurrentPage, Pages); OnFinishWizard(we); }