Inheritance: System.Windows.Forms.Panel
Exemple #1
0
 /// <summary>
 /// Adds an array of pages into the collection. Used by the Studio Designer generated coed
 /// </summary>
 /// <param name="pages">Array of pages to add</param>
 public void AddRange(WizardPage[] pages)
 {
     // Use external to validate and add each entry
     foreach(WizardPage page in pages)
     {
         this.Add(page);
     }
 }
Exemple #2
0
 /// <summary>
 /// Detects if a given Page is in the Collection
 /// </summary>
 /// <param name="value">Page to find</param>
 /// <returns></returns>
 public bool Contains( WizardPage value )
 {
     // If value is not of type Int16, this will return false.
     return( List.Contains( value ) );
 }
Exemple #3
0
 /// <summary>
 /// Adds a WizardPage into the Collection
 /// </summary>
 /// <param name="value">The page to add</param>
 /// <returns></returns>
 public int Add(WizardPage value )
 {
     int result = List.Add( value );
     return result;
 }
Exemple #4
0
 /// <summary>
 /// Removes the given page from the collection
 /// </summary>
 /// <param name="value">Page to remove</param>
 public void Remove( WizardPage value )
 {
     //Remove the item
     List.Remove( value );
 }
Exemple #5
0
 /// <summary>
 /// Adds a new page at a particular position in the Collection
 /// </summary>
 /// <param name="index">Position</param>
 /// <param name="value">Page to be added</param>
 public void Insert( int index, WizardPage value )
 {
     List.Insert(index, value );
 }
Exemple #6
0
 /// <summary>
 /// Finds the position of the page in the colleciton
 /// </summary>
 /// <param name="value">Page to find position of</param>
 /// <returns>Index of Page in collection</returns>
 public int IndexOf( WizardPage value )
 {
     return( List.IndexOf( value ) );
 }
Exemple #7
0
        protected internal void ActivatePage(WizardPage page)
        {
            //Deactivate the current
            if (vActivePage != null)
            {
                vActivePage.Visible = false;
            }

            //Activate the new page
            vActivePage = page;

            if (vActivePage != null)
            {
                //Ensure that this panel displays inside the wizard
                vActivePage.Parent = this;
                if (this.Contains(vActivePage) == false)
                {
                    this.Container.Add(vActivePage);
                }
                //Make it fill the space
                vActivePage.Dock = DockStyle.Fill;
                vActivePage.Visible = true;
                vActivePage.BringToFront();
                vActivePage.FocusFirstTabIndex();
            }

            //What should the back button say
            if (this.PageIndex > 0)
            {
                btnBack.Enabled = true;
            }
            else
            {
                btnBack.Enabled = false;
            }

            //What should the Next button say
            if (vPages.IndexOf(vActivePage) < vPages.Count-1
                && vActivePage.IsFinishPage == false)
            {
                btnNext.Text = btnNextLabel;
                btnNext.Enabled = true;
                //Don't close the wizard :)
                btnNext.DialogResult = DialogResult.None;
            }
            else
            {
                btnNext.Text = btnFinishLabel;
                //Dont allow a finish in designer
                if (DesignMode == true
                    && vPages.IndexOf(vActivePage) == vPages.Count-1)
                {
                    btnNext.Enabled = false;
                }
                else
                {
                    btnNext.Enabled = true;
                    //If Not in design mode then allow a close
                    btnNext.DialogResult = DialogResult.None;
                }
            }

            //Cause a refresh
            if (vActivePage != null)
                vActivePage.Invalidate();
            else
                this.Invalidate();
        }
Exemple #8
0
 /// <summary>
 /// Moves to the page given and calls <see cref="WizardPage.ShowFromNext"/>
 /// </summary>
 /// <remarks>Does NOT call <see cref="WizardPage.CloseFromNext"/> on the current page</remarks>
 /// <param name="page"></param>
 public void NextTo(WizardPage page)
 {
     //Since we have a page to go to, then there is no need to validate most of it
     ActivatePage(page);
     //Tell the application, I have just shown a page
     vActivePage.OnShowFromNext(this);
 }