/// <Summary> /// Gets the index in the collection of the specified , /// if it exists in the collection. /// </Summary> /// <Param name="value">The to locate in the collection.</Param> /// <Returns> /// The index in the collection of the specified object, if found; otherwise, -1. /// </Returns> public int IndexOf( WizardPage value ) { return this.List.IndexOf( value ); }
/// <Summary> /// Add an element of the specified to the end of the collection. /// </Summary> /// <Param name="title"> /// This is the title that will be displayed for this action /// </Param> /// <Param name="icon">This is the identifier to use for this action.</Param> /// <Param name="ctl">The Control Assocaited with the Page</Param> /// <Param name="help">The Help text for the Page</Param> /// <Returns>The index of the newly added</Returns> public WizardPage Add( string title, string icon, Control ctl, string help ) { WizardPage page = new WizardPage(title, icon, ctl, help); this.Add(page); return page; }
/// <Summary> /// Gets a value indicating whether the collection contains the specified . /// </Summary> /// <Param name="value">The to search for in the collection.</Param> /// <Returns> /// true if the collection contains the specified object; otherwise, false. /// </Returns> public bool Contains( WizardPage value ) { // If value is not of type WizardPage, this will return false. return List.Contains(value); }
/// <Summary> /// Initializes a new instance of the /// class containing the specified array of objects. /// </Summary> /// <Param name="value"> /// An array of objects with which to initialize the collection. /// </Param> public WizardPageCollection( WizardPage[] value ) { this.AddRange( value ); }
/// <Summary> /// Add an element of the specified to the end of the collection. /// </Summary> /// <Param name="value">An object of type to add to the collection.</Param> /// <Returns>The index of the newly added</Returns> public int Add( WizardPage value ) { return this.List.Add( value ); }
/// <Summary> /// Add an element of the specified to the collection at the designated index. /// </Summary> /// <Param name="index"> /// An Integer to indicate the location to add the object to the collection. /// </Param> /// <Param name="value">An object of type to add to the collection.</Param> public void Insert( int index, WizardPage value ) { this.List.Insert( index, value ); }
/// <Summary>Remove the specified object of type from the collection.</Summary> /// <Param name="value"> /// An object of type to remove from the collection. /// </Param> public void Remove( WizardPage value ) { this.List.Remove( value ); }
/// <Summary> /// Copies the elements of the specified array to the end of the collection. /// </Summary> /// <Param name="value"> /// An array of type containing the objects to add to the collection. /// </Param> public void AddRange( WizardPage[] value ) { int i; for (i = 0; i <= value.Length - 1; i++) { Add(value[i]); } }
/// <Summary>DisplaySuccessPage displays the Wizards success page</Summary> public void DisplaySuccessPage( string message ) { //First determine if a custom SuccessPage has been set, and load the default //if not if (m_SuccessPage == null) { WizardSuccess ctlSuccess = (WizardSuccess)this.LoadControl("~/admin/Wizards/Success.ascx"); ctlSuccess.Message = message; //get Wizard Body HtmlTableCell WizardBody = (HtmlTableCell)this.FindControl("WizardBody"); WizardBody.Controls.Add(ctlSuccess); m_SuccessPage = new WizardPage("Congratulations", "", ctlSuccess, WizardPageType.Success); } DisplayPage(-1, m_SuccessPage, false, false, false); //Hide any Help that might be visible DisplayHelp(false); //Disable Cancel to prevent ViewState issues cmdCancel.Enabled = true; cmdCancelIcon.Enabled = true; }
/// <Summary>DisplayPage displays a specific Page</Summary> /// <Param name="wizPage">The Page to display</Param> public void DisplayPage( int pageNo, WizardPage wizPage, bool ShowBack, bool ShowNext, bool ShowFinish ) { int iPage; Control ctl; if (wizPage == null) { wizPage = new WizardPage(); } //Set the Wizard Body for (iPage = 0; iPage <= Pages.Count - 1; iPage++) { WizardPage pge = Pages[iPage]; ctl = pge.Control; ctl.Visible = false; } ctl = wizPage.Control; ctl.Visible = true; //Set the Icons ImageUrl if (wizPage.Icon == "") { imgIcon.ImageUrl = "~/images/1x1.gif"; } else { imgIcon.ImageUrl = wizPage.Icon; } //Set the Titles Text and Style lblTitle.Text = wizPage.Title; //Show/Hide the Back/Next/Finish Buttons if ((CurrentPage > 0) && ShowBack) { cmdBack.Enabled = true; cmdBackIcon.Enabled = true; } else { cmdBack.Enabled = false; cmdBackIcon.Enabled = false; } if ((CurrentPage < m_Pages.Count - 1) && ShowNext) { cmdNext.Enabled = true; cmdNextIcon.Enabled = true; } else { cmdNext.Enabled = false; cmdNextIcon.Enabled = false; } if ((CurrentPage >= FinishPage) && ShowFinish) { cmdFinish.Enabled = true; cmdFinishIcon.Enabled = true; } else { cmdFinish.Enabled = false; cmdFinishIcon.Enabled = false; } //Set the Help if (wizPage.Help == "") { cmdHelp.Enabled = false; cmdHelpIcon.Enabled = false; } else { cmdHelp.Enabled = true; cmdHelpIcon.Enabled = true; } //Set the Pages lblPages.Text = string.Format(Localization.Localization.GetString("Pages"), CurrentPage + 1, Pages.Count); }
/// <Summary>DisplayFailurePage displays the Wizards failure page</Summary> public void DisplayFailurePage( string message ) { //First determine if a custom FailurePage has been set, and load the default //if not if (m_FailurePage == null) { WizardSuccess ctlSuccess = (WizardSuccess)this.LoadControl("~/admin/Wizards/Success.ascx"); ctlSuccess.Message = message; ctlSuccess.Type = false; //get Wizard Body HtmlTableCell WizardBody = (HtmlTableCell)this.FindControl("WizardBody"); WizardBody.Controls.Add(ctlSuccess); m_FailurePage = new WizardPage("Wizard Error", "", ctlSuccess, WizardPageType.Failure); } DisplayPage(-1, m_FailurePage, false, false, false); }
/// <Summary>AddPage adds a Wizard Page to the Control</Summary> /// <Param name="title">The Page's Title</Param> /// <Param name="icon">The Page's Icon</Param> /// <Param name="ctl">The Page's Control</Param> /// <Param name="type">The type of the Wizard Page</Param> /// <Param name="help">The Page's Help Text</Param> public void AddPage( string title, string icon, Control ctl, WizardPageType type, string help ) { switch (type) { case WizardPageType.Content: this.Pages.Add(title, icon, ctl, help); break; case WizardPageType.Failure: m_FailurePage = new WizardPage(title, icon, ctl, type, help); break; case WizardPageType.Success: m_SuccessPage = new WizardPage(title, icon, ctl, type, help); break; } }