/// <summary>
        /// Fires the CloseFromBack Event
        /// </summary>
        /// <param name="wiz">Wizard to pass into the sender argument</param>
        /// <returns>Index of Page that the event handlers would like to see next</returns>
        public int OnCloseFromBack(Wizard wiz)
        {
            int newPageIndex = wiz.PageIndex - 1;

            // Skip disabled pages
            while (newPageIndex >= 0 && !wiz.Pages[newPageIndex].Enabled)
            {
                newPageIndex--;
            }

            //Event args thinks that the next pgae will be the one before this one
            PageEventArgs e = new PageEventArgs(newPageIndex, wiz.Pages);

            //Tell anybody who listens
            if (CloseFromBack != null)
            {
                CloseFromBack(wiz, e);
            }

            if (e.Cancel)
            {
                return(wiz.PageIndex);
            }
            else
            {
                return(e.PageIndex);
            }
        }
        /// <summary>
        /// Fires the CloseFromNextEvent
        /// </summary>
        /// <param name="wiz">Sender</param>
        public int OnCloseFromNext(Wizard wiz)
        {
            int newPageIndex = wiz.PageIndex + 1;

            // Skip disabled pages
            while (newPageIndex < wiz.Pages.Count && !wiz.Pages[newPageIndex].Enabled)
            {
                newPageIndex++;
            }

            //Event args thinks that the next pgae will be the one before this one
            PageEventArgs e = new PageEventArgs(newPageIndex, wiz.Pages);

            //Tell anybody who listens
            if (CloseFromNext != null)
            {
                CloseFromNext(wiz, e);
            }

            //And then tell whomever called me what the prefered page is
            if (e.Cancel)
            {
                return(wiz.PageIndex);
            }
            else
            {
                return(e.PageIndex);
            }
        }
Example #3
0
        /// <summary>
        /// Fires the CloseFromNextEvent
        /// </summary>
        /// <param name="wiz">Sender</param>
        public int OnCloseFromNext(Wizard wiz)
        {
            int newPageIndex = wiz.PageIndex + 1;

            // Skip disabled pages
            while (newPageIndex < wiz.Pages.Count && !wiz.Pages[newPageIndex].Enabled)
            {
                newPageIndex++;
            }

            //Event args thinks that the next pgae will be the one before this one
            PageEventArgs e = new PageEventArgs(newPageIndex, wiz.Pages);
            //Tell anybody who listens
            if (CloseFromNext != null)
                CloseFromNext(wiz, e);

            //And then tell whomever called me what the prefered page is
            if (e.Cancel)
                return wiz.PageIndex;
            else
                return e.PageIndex;
        }
Example #4
0
        /// <summary>
        /// Fires the CloseFromBack Event
        /// </summary>
        /// <param name="wiz">Wizard to pass into the sender argument</param>
        /// <returns>Index of Page that the event handlers would like to see next</returns>
        public int OnCloseFromBack(Wizard wiz)
        {
            int newPageIndex = wiz.PageIndex - 1;

            // Skip disabled pages
            while (newPageIndex >= 0 && !wiz.Pages[newPageIndex].Enabled)
            {
                newPageIndex--;
            }

            //Event args thinks that the next pgae will be the one before this one
            PageEventArgs e = new PageEventArgs(newPageIndex, wiz.Pages);

            //Tell anybody who listens
            if (CloseFromBack != null)
                CloseFromBack(wiz, e);

            if (e.Cancel)
                return wiz.PageIndex;
            else
                return e.PageIndex;
        }