/// <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); } }
/// <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; }
/// <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); }
/// <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); }
/// <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)); }
/// <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)); }
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 = "&Next >"; btnNext.Enabled = true; //Don't close the wizard :) btnNext.DialogResult = DialogResult.None; } else { btnNext.Text = "Fi&nish"; //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.OK; } } //Cause a refresh if (vActivePage != null) vActivePage.Invalidate(); else this.Invalidate(); }
/// <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); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(NewFileCtrl)); this.wizard1 = new Gui.Wizard.Wizard(); this.pageWizardSelect = new Gui.Wizard.WizardPage(); this.treeView1 = new System.Windows.Forms.TreeView(); this.label1 = new System.Windows.Forms.Label(); this.header1 = new Gui.Wizard.Header(); this.wizard1.SuspendLayout(); this.pageWizardSelect.SuspendLayout(); this.SuspendLayout(); // // wizard1 // this.wizard1.CloneOnFinish = true; this.wizard1.Controls.Add(this.pageWizardSelect); this.wizard1.Dock = System.Windows.Forms.DockStyle.Fill; this.wizard1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.wizard1.Location = new System.Drawing.Point(0, 0); this.wizard1.Name = "wizard1"; this.wizard1.Pages.AddRange(new Gui.Wizard.WizardPage[] { this.pageWizardSelect}); this.wizard1.Size = new System.Drawing.Size(488, 475); this.wizard1.TabIndex = 0; this.wizard1.FinishSelected += new System.EventHandler(this.WizardFinishSelected); // // pageWizardSelect // this.pageWizardSelect.Controls.Add(this.treeView1); this.pageWizardSelect.Controls.Add(this.label1); this.pageWizardSelect.Controls.Add(this.header1); this.pageWizardSelect.Dock = System.Windows.Forms.DockStyle.Fill; this.pageWizardSelect.IsFinishPage = false; this.pageWizardSelect.Location = new System.Drawing.Point(0, 0); this.pageWizardSelect.Name = "pageWizardSelect"; this.pageWizardSelect.Size = new System.Drawing.Size(488, 427); this.pageWizardSelect.TabIndex = 1; this.pageWizardSelect.ShowFromBack += new System.EventHandler(this.FirstPageRedisplayed); this.pageWizardSelect.CloseFromNext += new Gui.Wizard.PageEventHandler(this.ProfileSelected); // // treeView1 // this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.treeView1.HideSelection = false; this.treeView1.ImageIndex = -1; this.treeView1.Location = new System.Drawing.Point(8, 96); this.treeView1.Name = "treeView1"; this.treeView1.Scrollable = false; this.treeView1.SelectedImageIndex = -1; this.treeView1.Size = new System.Drawing.Size(472, 320); this.treeView1.TabIndex = 2; // // label1 // this.label1.Location = new System.Drawing.Point(8, 72); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(100, 16); this.label1.TabIndex = 1; this.label1.Text = "&Wizards:"; // // header1 // this.header1.BackColor = System.Drawing.SystemColors.Control; this.header1.CausesValidation = false; this.header1.Description = "The list below shows the types of document currently registered with XEditNet"; this.header1.Dock = System.Windows.Forms.DockStyle.Top; this.header1.Image = ((System.Drawing.Image)(resources.GetObject("header1.Image"))); this.header1.Location = new System.Drawing.Point(0, 0); this.header1.Name = "header1"; this.header1.Size = new System.Drawing.Size(488, 64); this.header1.TabIndex = 0; this.header1.Title = "Select a Wizard"; // // NewFileCtrl // this.Controls.Add(this.wizard1); this.Name = "NewFileCtrl"; this.Size = new System.Drawing.Size(488, 475); this.wizard1.ResumeLayout(false); this.pageWizardSelect.ResumeLayout(false); this.ResumeLayout(false); }
/// <param name="wiz">Sender</param> public void OnFinish(WizardPage page) { if (Finish != null) if (page.IsFinishPage) Finish( this,EventArgs.Empty); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(NewFileCtrl)); this.wizard1 = new Gui.Wizard.Wizard(); this.pageWizardSelect = new Gui.Wizard.WizardPage(); this.treeView1 = new System.Windows.Forms.TreeView(); this.label1 = new System.Windows.Forms.Label(); this.header1 = new Gui.Wizard.Header(); this.wizard1.SuspendLayout(); this.pageWizardSelect.SuspendLayout(); this.SuspendLayout(); // // wizard1 // this.wizard1.CloneOnFinish = true; this.wizard1.Controls.Add(this.pageWizardSelect); this.wizard1.Dock = System.Windows.Forms.DockStyle.Fill; this.wizard1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.wizard1.Location = new System.Drawing.Point(0, 0); this.wizard1.Name = "wizard1"; this.wizard1.Pages.AddRange(new Gui.Wizard.WizardPage[] { this.pageWizardSelect }); this.wizard1.Size = new System.Drawing.Size(488, 475); this.wizard1.TabIndex = 0; this.wizard1.FinishSelected += new System.EventHandler(this.WizardFinishSelected); // // pageWizardSelect // this.pageWizardSelect.Controls.Add(this.treeView1); this.pageWizardSelect.Controls.Add(this.label1); this.pageWizardSelect.Controls.Add(this.header1); this.pageWizardSelect.Dock = System.Windows.Forms.DockStyle.Fill; this.pageWizardSelect.IsFinishPage = false; this.pageWizardSelect.Location = new System.Drawing.Point(0, 0); this.pageWizardSelect.Name = "pageWizardSelect"; this.pageWizardSelect.Size = new System.Drawing.Size(488, 427); this.pageWizardSelect.TabIndex = 1; this.pageWizardSelect.ShowFromBack += new System.EventHandler(this.FirstPageRedisplayed); this.pageWizardSelect.CloseFromNext += new Gui.Wizard.PageEventHandler(this.ProfileSelected); // // treeView1 // this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.treeView1.HideSelection = false; this.treeView1.ImageIndex = -1; this.treeView1.Location = new System.Drawing.Point(8, 96); this.treeView1.Name = "treeView1"; this.treeView1.Scrollable = false; this.treeView1.SelectedImageIndex = -1; this.treeView1.Size = new System.Drawing.Size(472, 320); this.treeView1.TabIndex = 2; // // label1 // this.label1.Location = new System.Drawing.Point(8, 72); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(100, 16); this.label1.TabIndex = 1; this.label1.Text = "&Wizards:"; // // header1 // this.header1.BackColor = System.Drawing.SystemColors.Control; this.header1.CausesValidation = false; this.header1.Description = "The list below shows the types of document currently registered with XEditNet"; this.header1.Dock = System.Windows.Forms.DockStyle.Top; this.header1.Image = ((System.Drawing.Image)(resources.GetObject("header1.Image"))); this.header1.Location = new System.Drawing.Point(0, 0); this.header1.Name = "header1"; this.header1.Size = new System.Drawing.Size(488, 64); this.header1.TabIndex = 0; this.header1.Title = "Select a Wizard"; // // NewFileCtrl // this.Controls.Add(this.wizard1); this.Name = "NewFileCtrl"; this.Size = new System.Drawing.Size(488, 475); this.wizard1.ResumeLayout(false); this.pageWizardSelect.ResumeLayout(false); this.ResumeLayout(false); }
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 = "&Next >"; btnNext.Enabled = true; //Don't close the wizard :) btnNext.DialogResult = DialogResult.None; } else { btnNext.Text = "Fi&nish"; //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.OK; } } if (m_containingForm != null) { m_containingForm.AcceptButton = btnNext; } //Cause a refresh if (vActivePage != null) { vActivePage.Invalidate(); } else { this.Invalidate(); } }