/// <summary> /// Constructor. /// </summary> /// <param name="previousPage">The previous page of the wizard to return to in case of a "PageBack" event.</param> public PageEncryption(WizardPage previousPage) { this.previousPage = previousPage; this.pageSearch = new PageSearch(this); InitializeComponent(); CheckBox_CheckedChanged(null, new EventArgs()); }
public WizardValidatePageEventArgs(WizardPage page, bool thisPageOnly) : base(page) { _thisPageOnly = thisPageOnly; _valid = true; _message = null; }
public static void AddDataContextWizard(List<WizardPage> pages, WizardPage propertiesPage) { if (!(WizardDataStore.Data is IQueryData)) throw new Exception("Make sure your data is of type IQueryData"); pages.Add(new DbContextPage()); pages.Add(propertiesPage); }
/// <summary> /// Constructor. /// </summary> /// <param name="previousPage">The previous page of the wizard to return to in case of a "PageBack" event.</param> public PageFragment(WizardPage previousPage) { this.previousPage = previousPage; this.pageSearch = new PageSearch(this); InitializeComponent(); hexMatch.ByteProvider = matchByteProvider; matchByteProvider.Changed += matchByteProvider_Changed; }
/// <summary> /// Adds the elements of an array of WizardPage objects to the end of the WizardPagesCollection. /// </summary> /// <param name="pages">An array on WizardPage objects to be added. /// The array itself cannot be null, but it can contain elements that are null.</param> public void AddRange(WizardPage[] pages) { // Use external to validate and add each entry foreach(WizardPage page in pages) { this.Add(page); } }
public Wizard Build() { var firstPage = new WizardPage { Header = "Create project from the simple template", InputFields = new WizardInputField[]{ new WizardFieldDescription{Description = "This template is a very simple example of a wizard, with just one page and one input field."}, new WizardFieldDescription{Description = "Enter a test message to display."}, new TextWizardInputField() { TemplateId = "$custommessage$" } } }; var wizard = new Wizard { Title = "Simple Wizard", Pages = new List<WizardPage> { firstPage } }; return wizard; }
/// <summary> /// Activates the given page of the wizard. /// </summary> /// <param name="page">The page of the wizard that should be activated.</param> private void ActivatePage(WizardPage page) { // store a reference to the new page of the wizard currentPage = page; // clear the current page of the wizard first pagePanel.Controls.Clear(); // add wizard page to the wizard pagePanel.Controls.Add(page); page.Size = pagePanel.Size; page.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right; page.ReadyChanged -= new EventHandler<EventArgs>(Page_ReadyChanged); page.ReadyChanged += new EventHandler<EventArgs>(Page_ReadyChanged); // set the title and subtitle of the wizard page lblTitle.Text = page.Title; rtfSubtitle.Text = page.Subtitle; // update the buttons of the wizard btnBack.Enabled = !page.FirstPage; if (page.LastPage) { btnNext.Enabled = false; btnFinish.Enabled = page.Ready; AcceptButton = btnFinish; } else { btnFinish.Enabled = false; btnNext.Enabled = page.Ready; AcceptButton = btnNext; } // finalize activating the wizard page page.OnPageActivated(new EventArgs()); }
protected void RegisterStandardPage(WizardPage page) { _standardPages.Add(page); }
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 btnBack.Text = this.BackButtonText; 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 = this.NextButtonText;//"&Next >"; btnNext.Enabled = true; //Don't close the wizard :) btnNext.DialogResult = DialogResult.None; } else { btnNext.Text = this.FinishButtonText; //"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> /// Constructor. /// </summary> /// <param name="previousPage">The previous page of the wizard to return to in case of a "PageBack" event.</param> public PageTrueCrypt(WizardPage previousPage) { this.previousPage = previousPage; this.pageEncryption = new PageEncryption(this); InitializeComponent(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WsdlWizardForm)); this.wsdlWizardCtrl = new WizardControl.Wizard(); this.wizardPageBasicMetadata = new WizardControl.WizardPage(); this.tbServiceDoc = new System.Windows.Forms.TextBox(); this.lblServiceDoc = new System.Windows.Forms.Label(); this.lblNamespace = new System.Windows.Forms.Label(); this.tbNamespace = new System.Windows.Forms.TextBox(); this.lblServiceName = new System.Windows.Forms.Label(); this.tbServiceName = new System.Windows.Forms.TextBox(); this.wizardPageSchemaImports = new WizardControl.WizardPage(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.llRemoveImport = new System.Windows.Forms.LinkLabel(); this.llAddImport = new System.Windows.Forms.LinkLabel(); this.importsListView = new Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView(); this.wizardPageOperationsList = new WizardControl.WizardPage(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.operationsListView = new Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView(); this.llAddOperation = new System.Windows.Forms.LinkLabel(); this.llRemoveOperation = new System.Windows.Forms.LinkLabel(); this.cbInfer = new System.Windows.Forms.CheckBox(); this.panel1 = new System.Windows.Forms.Panel(); this.tbEdit = new System.Windows.Forms.TextBox(); this.cbMEPs = new System.Windows.Forms.ComboBox(); this.wizardPageMessageMapping = new WizardControl.WizardPage(); this.ptvServiceOperations = new WRM.Windows.Forms.PropertyTree(); this.wizardPageAdditionalOptions = new WizardControl.WizardPage(); this.cbSoap12 = new System.Windows.Forms.CheckBox(); this.cbSoap11 = new System.Windows.Forms.CheckBox(); this.cbNeedsServiceElement = new System.Windows.Forms.CheckBox(); this.cbCodeGenDialog = new System.Windows.Forms.CheckBox(); this.wizardPageAlternativeXSDPaths = new WizardControl.WizardPage(); this.xsdpathsListView = new Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.toolTipPath = new System.Windows.Forms.ToolTip(this.components); this.wsdlWizardCtrl.SuspendLayout(); this.wizardPageBasicMetadata.SuspendLayout(); this.wizardPageSchemaImports.SuspendLayout(); this.groupBox2.SuspendLayout(); this.wizardPageOperationsList.SuspendLayout(); this.groupBox1.SuspendLayout(); this.panel1.SuspendLayout(); this.wizardPageMessageMapping.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ptvServiceOperations)).BeginInit(); this.wizardPageAdditionalOptions.SuspendLayout(); this.wizardPageAlternativeXSDPaths.SuspendLayout(); this.SuspendLayout(); // // wsdlWizardCtrl // this.wsdlWizardCtrl.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.wsdlWizardCtrl.BannerBitmap = ((System.Drawing.Image)(resources.GetObject("wsdlWizardCtrl.BannerBitmap"))); this.wsdlWizardCtrl.CloseForm = false; this.wsdlWizardCtrl.Controls.Add(this.wizardPageBasicMetadata); this.wsdlWizardCtrl.Controls.Add(this.wizardPageSchemaImports); this.wsdlWizardCtrl.Controls.Add(this.wizardPageOperationsList); this.wsdlWizardCtrl.Controls.Add(this.wizardPageMessageMapping); this.wsdlWizardCtrl.Controls.Add(this.wizardPageAdditionalOptions); this.wsdlWizardCtrl.Controls.Add(this.wizardPageAlternativeXSDPaths); this.wsdlWizardCtrl.Location = new System.Drawing.Point(0, 0); this.wsdlWizardCtrl.Name = "wsdlWizardCtrl"; this.wsdlWizardCtrl.Size = new System.Drawing.Size(497, 360); this.wsdlWizardCtrl.TabIndex = 0; this.wsdlWizardCtrl.Title = "Generate WSDL"; this.wsdlWizardCtrl.WelcomeBitmap = ((System.Drawing.Image)(resources.GetObject("wsdlWizardCtrl.WelcomeBitmap"))); this.wsdlWizardCtrl.WelcomeText = resources.GetString("wsdlWizardCtrl.WelcomeText"); this.wsdlWizardCtrl.BeforeSummaryPageDisplayed += new WizardControl.Wizard.BeforeSummaryPageDisplayedEventHandler(this.wsdlWizardCtrl_BeforeSummaryPageDisplayed); this.wsdlWizardCtrl.Finished += new WizardControl.Wizard.FinishedEventHandler(this.wsdlWizardCtrl_Finished); this.wsdlWizardCtrl.Load += new System.EventHandler(this.wsdlWizardCtrl_Load); this.wsdlWizardCtrl.Cancelled += new WizardControl.Wizard.CancelledEventHandler(this.wsdlWizardCtrl_Cancelled); this.wsdlWizardCtrl.BeforePageDisplayed += new WizardControl.Wizard.BeforePageDisplayedEventHandler(this.wsdlWizardCtrl_BeforePageDisplayed); this.wsdlWizardCtrl.AfterPageDisplayed += new WizardControl.Wizard.AfterPageDisplayedEventHandler(this.wsdlWizardCtrl_AfterPageDisplayed); this.wsdlWizardCtrl.ValidatePage += new WizardControl.Wizard.ValidatePageEventHandler(this.wsdlWizardCtrl_ValidatePage); // // wizardPageBasicMetadata // this.wizardPageBasicMetadata.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.wizardPageBasicMetadata.Controls.Add(this.tbServiceDoc); this.wizardPageBasicMetadata.Controls.Add(this.lblServiceDoc); this.wizardPageBasicMetadata.Controls.Add(this.lblNamespace); this.wizardPageBasicMetadata.Controls.Add(this.tbNamespace); this.wizardPageBasicMetadata.Controls.Add(this.lblServiceName); this.wizardPageBasicMetadata.Controls.Add(this.tbServiceName); this.wizardPageBasicMetadata.Description = "Please enter the name and the XML namespace of the Web Service."; this.wizardPageBasicMetadata.Heading = "Step 1: Specify your Web Service\'s basic settings"; this.wizardPageBasicMetadata.Location = new System.Drawing.Point(21, 71); this.wizardPageBasicMetadata.Name = "wizardPageBasicMetadata"; this.wizardPageBasicMetadata.Size = new System.Drawing.Size(456, 230); this.wizardPageBasicMetadata.TabIndex = 0; // // tbServiceDoc // this.tbServiceDoc.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.tbServiceDoc.Location = new System.Drawing.Point(120, 72); this.tbServiceDoc.Multiline = true; this.tbServiceDoc.Name = "tbServiceDoc"; this.tbServiceDoc.Size = new System.Drawing.Size(312, 88); this.tbServiceDoc.TabIndex = 5; // // lblServiceDoc // this.lblServiceDoc.Location = new System.Drawing.Point(24, 72); this.lblServiceDoc.Name = "lblServiceDoc"; this.lblServiceDoc.Size = new System.Drawing.Size(100, 23); this.lblServiceDoc.TabIndex = 4; this.lblServiceDoc.Text = "Documentation:"; // // lblNamespace // this.lblNamespace.Location = new System.Drawing.Point(24, 40); this.lblNamespace.Name = "lblNamespace"; this.lblNamespace.Size = new System.Drawing.Size(96, 23); this.lblNamespace.TabIndex = 3; this.lblNamespace.Text = "XML namespace:"; // // tbNamespace // this.tbNamespace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbNamespace.Location = new System.Drawing.Point(120, 40); this.tbNamespace.Name = "tbNamespace"; this.tbNamespace.Size = new System.Drawing.Size(312, 20); this.tbNamespace.TabIndex = 2; // // lblServiceName // this.lblServiceName.Location = new System.Drawing.Point(24, 8); this.lblServiceName.Name = "lblServiceName"; this.lblServiceName.Size = new System.Drawing.Size(88, 23); this.lblServiceName.TabIndex = 1; this.lblServiceName.Text = "Service name:"; this.toolTip1.SetToolTip(this.lblServiceName, "\'Service name\' specifies the name of the Web Service binding to be generated. Thi" + "s will be the e.g. the class name for your Web Service proxy when generated from" + " the service description."); // // tbServiceName // this.tbServiceName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbServiceName.Location = new System.Drawing.Point(120, 6); this.tbServiceName.Name = "tbServiceName"; this.tbServiceName.Size = new System.Drawing.Size(312, 20); this.tbServiceName.TabIndex = 0; this.toolTip1.SetToolTip(this.tbServiceName, "\'Service name\' specifies the name of the Web Service binding to be generated. Thi" + "s will be the e.g. the class name for your Web Service proxy when generated from" + " the service description."); // // wizardPageSchemaImports // this.wizardPageSchemaImports.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.wizardPageSchemaImports.Controls.Add(this.groupBox2); this.wizardPageSchemaImports.Cursor = System.Windows.Forms.Cursors.Default; this.wizardPageSchemaImports.Description = "Please add additional message schemas from XSD files as appropriate."; this.wizardPageSchemaImports.Heading = "Step 2: Specify additional message schemas"; this.wizardPageSchemaImports.Location = new System.Drawing.Point(21, 71); this.wizardPageSchemaImports.Name = "wizardPageSchemaImports"; this.wizardPageSchemaImports.Size = new System.Drawing.Size(456, 230); this.wizardPageSchemaImports.TabIndex = 2; // // groupBox2 // this.groupBox2.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.groupBox2.Controls.Add(this.llRemoveImport); this.groupBox2.Controls.Add(this.llAddImport); this.groupBox2.Controls.Add(this.importsListView); this.groupBox2.Location = new System.Drawing.Point(8, 3); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(440, 224); this.groupBox2.TabIndex = 2; this.groupBox2.TabStop = false; this.groupBox2.Text = "XSD Imports:"; // // llRemoveImport // this.llRemoveImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.llRemoveImport.Location = new System.Drawing.Point(95, 205); this.llRemoveImport.Name = "llRemoveImport"; this.llRemoveImport.Size = new System.Drawing.Size(100, 16); this.llRemoveImport.TabIndex = 4; this.llRemoveImport.TabStop = true; this.llRemoveImport.Text = "Remove import"; this.llRemoveImport.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llRemoveImport_LinkClicked); // // llAddImport // this.llAddImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.llAddImport.Location = new System.Drawing.Point(8, 205); this.llAddImport.Name = "llAddImport"; this.llAddImport.Size = new System.Drawing.Size(81, 15); this.llAddImport.TabIndex = 3; this.llAddImport.TabStop = true; this.llAddImport.Text = "Add import"; this.llAddImport.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llAddImport_LinkClicked); // // importsListView // this.importsListView.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.importsListView.DisabledColumns = ((System.Collections.ArrayList)(resources.GetObject("importsListView.DisabledColumns"))); this.importsListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.importsListView.FullRowSelect = true; this.importsListView.GridLines = true; this.importsListView.Location = new System.Drawing.Point(8, 16); this.importsListView.Name = "importsListView"; this.importsListView.Size = new System.Drawing.Size(424, 184); this.importsListView.TabIndex = 2; this.importsListView.UseCompatibleStateImageBehavior = false; this.importsListView.View = System.Windows.Forms.View.Details; this.importsListView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.importsListView_MouseMove); // // wizardPageOperationsList // this.wizardPageOperationsList.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.wizardPageOperationsList.Controls.Add(this.groupBox1); this.wizardPageOperationsList.Controls.Add(this.panel1); this.wizardPageOperationsList.Description = "Please add operations to the Web Service as needed."; this.wizardPageOperationsList.Heading = "Step 3: Specify settings for your Web Service\'s operations."; this.wizardPageOperationsList.Location = new System.Drawing.Point(21, 71); this.wizardPageOperationsList.Name = "wizardPageOperationsList"; this.wizardPageOperationsList.Size = new System.Drawing.Size(456, 230); this.wizardPageOperationsList.TabIndex = 1; // // groupBox1 // this.groupBox1.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.groupBox1.Controls.Add(this.operationsListView); this.groupBox1.Controls.Add(this.llAddOperation); this.groupBox1.Controls.Add(this.llRemoveOperation); this.groupBox1.Controls.Add(this.cbInfer); this.groupBox1.Location = new System.Drawing.Point(8, 3); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(440, 224); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; this.groupBox1.Text = "Operations:"; // // operationsListView // this.operationsListView.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.operationsListView.DisabledColumns = ((System.Collections.ArrayList)(resources.GetObject("operationsListView.DisabledColumns"))); this.operationsListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.operationsListView.FullRowSelect = true; this.operationsListView.GridLines = true; this.operationsListView.Location = new System.Drawing.Point(8, 16); this.operationsListView.Name = "operationsListView"; this.operationsListView.Size = new System.Drawing.Size(424, 184); this.operationsListView.TabIndex = 0; this.operationsListView.UseCompatibleStateImageBehavior = false; this.operationsListView.View = System.Windows.Forms.View.Details; // // llAddOperation // this.llAddOperation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.llAddOperation.Location = new System.Drawing.Point(7, 205); this.llAddOperation.Name = "llAddOperation"; this.llAddOperation.Size = new System.Drawing.Size(81, 15); this.llAddOperation.TabIndex = 1; this.llAddOperation.TabStop = true; this.llAddOperation.Text = "Add operation"; this.llAddOperation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llAddOperation_LinkClicked); // // llRemoveOperation // this.llRemoveOperation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.llRemoveOperation.Location = new System.Drawing.Point(95, 205); this.llRemoveOperation.Name = "llRemoveOperation"; this.llRemoveOperation.Size = new System.Drawing.Size(100, 16); this.llRemoveOperation.TabIndex = 2; this.llRemoveOperation.TabStop = true; this.llRemoveOperation.Text = "Remove operation"; this.llRemoveOperation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llRemoveOperation_LinkClicked); // // cbInfer // this.cbInfer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.cbInfer.Location = new System.Drawing.Point(336, 204); this.cbInfer.Name = "cbInfer"; this.cbInfer.Size = new System.Drawing.Size(104, 16); this.cbInfer.TabIndex = 4; this.cbInfer.Text = "Infer Operations"; this.cbInfer.CheckedChanged += new System.EventHandler(this.cbInfer_CheckedChanged); // // panel1 // this.panel1.Controls.Add(this.tbEdit); this.panel1.Controls.Add(this.cbMEPs); this.panel1.Location = new System.Drawing.Point(24, 32); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(408, 192); this.panel1.TabIndex = 2; // // tbEdit // this.tbEdit.Location = new System.Drawing.Point(16, 16); this.tbEdit.Name = "tbEdit"; this.tbEdit.Size = new System.Drawing.Size(100, 20); this.tbEdit.TabIndex = 3; this.tbEdit.Text = "textBox2"; this.tbEdit.Visible = false; // // cbMEPs // this.cbMEPs.ItemHeight = 13; this.cbMEPs.Items.AddRange(new object[] { "Request/Response", "One-Way"}); this.cbMEPs.Location = new System.Drawing.Point(272, 16); this.cbMEPs.Name = "cbMEPs"; this.cbMEPs.Size = new System.Drawing.Size(121, 21); this.cbMEPs.TabIndex = 2; this.cbMEPs.Text = "comboBox1"; this.cbMEPs.Visible = false; // // wizardPageMessageMapping // this.wizardPageMessageMapping.Controls.Add(this.ptvServiceOperations); this.wizardPageMessageMapping.Description = "Please enter all details for the service\'s operations and messages."; this.wizardPageMessageMapping.Heading = "Step 4: Specify the operation\'s message parameters"; this.wizardPageMessageMapping.Location = new System.Drawing.Point(21, 71); this.wizardPageMessageMapping.Name = "wizardPageMessageMapping"; this.wizardPageMessageMapping.Size = new System.Drawing.Size(456, 230); this.wizardPageMessageMapping.TabIndex = 3; // // ptvServiceOperations // this.ptvServiceOperations.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.ptvServiceOperations.ImageList = null; this.ptvServiceOperations.Indent = 19; this.ptvServiceOperations.Location = new System.Drawing.Point(0, -1); this.ptvServiceOperations.Name = "ptvServiceOperations"; this.ptvServiceOperations.PaneHeaderVisible = false; this.ptvServiceOperations.SelectedImageIndex = -1; this.ptvServiceOperations.SelectedPaneNode = null; this.ptvServiceOperations.ShowLines = true; this.ptvServiceOperations.ShowPlusMinus = true; this.ptvServiceOperations.ShowRootLines = true; this.ptvServiceOperations.Size = new System.Drawing.Size(456, 232); this.ptvServiceOperations.SplitterColor = System.Drawing.SystemColors.AppWorkspace; this.ptvServiceOperations.SplitterLeft = 184; this.ptvServiceOperations.TabIndex = 1; // // wizardPageAdditionalOptions // this.wizardPageAdditionalOptions.Controls.Add(this.cbSoap12); this.wizardPageAdditionalOptions.Controls.Add(this.cbSoap11); this.wizardPageAdditionalOptions.Controls.Add(this.cbNeedsServiceElement); this.wizardPageAdditionalOptions.Controls.Add(this.cbCodeGenDialog); this.wizardPageAdditionalOptions.Description = "Please select any additional options to configure."; this.wizardPageAdditionalOptions.Heading = "Step 5: Additional options"; this.wizardPageAdditionalOptions.Location = new System.Drawing.Point(21, 71); this.wizardPageAdditionalOptions.Name = "wizardPageAdditionalOptions"; this.wizardPageAdditionalOptions.Size = new System.Drawing.Size(456, 230); this.wizardPageAdditionalOptions.TabIndex = 4; // // cbSoap12 // this.cbSoap12.AutoSize = true; this.cbSoap12.Location = new System.Drawing.Point(24, 87); this.cbSoap12.Name = "cbSoap12"; this.cbSoap12.Size = new System.Drawing.Size(144, 17); this.cbSoap12.TabIndex = 12; this.cbSoap12.Text = "Create SOAP 1.2 binding"; this.cbSoap12.UseVisualStyleBackColor = true; // // cbSoap11 // this.cbSoap11.AutoSize = true; this.cbSoap11.Checked = true; this.cbSoap11.CheckState = System.Windows.Forms.CheckState.Checked; this.cbSoap11.Enabled = false; this.cbSoap11.Location = new System.Drawing.Point(24, 51); this.cbSoap11.Name = "cbSoap11"; this.cbSoap11.Size = new System.Drawing.Size(144, 17); this.cbSoap11.TabIndex = 11; this.cbSoap11.Text = "Create SOAP 1.1 binding"; this.cbSoap11.UseVisualStyleBackColor = true; // // cbNeedsServiceElement // this.cbNeedsServiceElement.Location = new System.Drawing.Point(24, 8); this.cbNeedsServiceElement.Name = "cbNeedsServiceElement"; this.cbNeedsServiceElement.Size = new System.Drawing.Size(192, 24); this.cbNeedsServiceElement.TabIndex = 10; this.cbNeedsServiceElement.Text = "Generate <service> element."; this.toolTip1.SetToolTip(this.cbNeedsServiceElement, "Enable this option if you want to have a <service> element generated for the WSDL" + " service description."); // // cbCodeGenDialog // this.cbCodeGenDialog.Location = new System.Drawing.Point(24, 169); this.cbCodeGenDialog.Name = "cbCodeGenDialog"; this.cbCodeGenDialog.Size = new System.Drawing.Size(408, 24); this.cbCodeGenDialog.TabIndex = 6; this.cbCodeGenDialog.Text = "Open the code generation dialog after this wizard closes."; this.cbCodeGenDialog.CheckedChanged += new System.EventHandler(this.cbCodeGenDialog_CheckedChanged); // // wizardPageAlternativeXSDPaths // this.wizardPageAlternativeXSDPaths.Controls.Add(this.xsdpathsListView); this.wizardPageAlternativeXSDPaths.Description = "Please select the alternative XSD path for each XSD file imported."; this.wizardPageAlternativeXSDPaths.Heading = "Step 6: Alternative XSD Paths"; this.wizardPageAlternativeXSDPaths.Location = new System.Drawing.Point(21, 71); this.wizardPageAlternativeXSDPaths.Name = "wizardPageAlternativeXSDPaths"; this.wizardPageAlternativeXSDPaths.Size = new System.Drawing.Size(456, 230); this.wizardPageAlternativeXSDPaths.TabIndex = 5; // // xsdpathsListView // this.xsdpathsListView.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.xsdpathsListView.DisabledColumns = ((System.Collections.ArrayList)(resources.GetObject("xsdpathsListView.DisabledColumns"))); this.xsdpathsListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.xsdpathsListView.FullRowSelect = true; this.xsdpathsListView.GridLines = true; this.xsdpathsListView.Location = new System.Drawing.Point(0, 0); this.xsdpathsListView.Name = "xsdpathsListView"; this.xsdpathsListView.Size = new System.Drawing.Size(456, 224); this.xsdpathsListView.TabIndex = 3; this.xsdpathsListView.UseCompatibleStateImageBehavior = false; this.xsdpathsListView.View = System.Windows.Forms.View.Details; // // openFileDialog1 // this.openFileDialog1.Filter = "XSD Files(*.xsd)|*.xsd"; // // toolTipPath // this.toolTipPath.AutomaticDelay = 1000; // // WsdlWizardForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(497, 360); this.Controls.Add(this.wsdlWizardCtrl); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.HelpButton = true; this.Name = "WsdlWizardForm"; this.ShowInTaskbar = false; this.Text = "Create a WSDL Interface Description"; this.Closing += new System.ComponentModel.CancelEventHandler(this.WsdlWizardForm_Closing); this.Load += new System.EventHandler(this.WSDLWizard_Load); this.wsdlWizardCtrl.ResumeLayout(false); this.wizardPageBasicMetadata.ResumeLayout(false); this.wizardPageBasicMetadata.PerformLayout(); this.wizardPageSchemaImports.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.wizardPageOperationsList.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.wizardPageMessageMapping.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.ptvServiceOperations)).EndInit(); this.wizardPageAdditionalOptions.ResumeLayout(false); this.wizardPageAdditionalOptions.PerformLayout(); this.wizardPageAlternativeXSDPaths.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Adds an object to the end of the WizardPagesCollection. /// </summary> /// <param name="value">The WizardPage to be added. /// The value can be null.</param> /// <returns>An Integer value representing the index at which the value has been added.</returns> public int Add(WizardPage value ) { int result = List.Add( value ); return result; }
public HelpAwareWizardPage( IKeyboardEditorRoot root, WizardManager wizardManager, WizardPage next, string title = "" ) : this(root, wizardManager, next, false, title) { }
/// <summary> /// Displays the previous wizard step. /// </summary> internal static void PreviousStep() { LibCommunications.gAddLog(String.Format("Moving to previous step, {0} to {1} (of {2} total)", CurrentStep, CurrentStep - 1, StepsToRun.Length)); CurrentStep--; if (CurrentStep < 0) { #if !FULL_TOOLSET Program.NextForm = new SelectSteps(Settings.TranslationProvider); #else (new SelectSteps(Settings.TranslationProvider)).Show(MainForm); #endif return; } WizardPage form = CreateStep(); #if !FULL_TOOLSET Program.NextForm = form; #else form.Show(MainForm); #endif }
/// <summary> /// Performs the validation on a single page within the wizard. /// </summary> /// <param name="page"></param> /// <returns></returns> private bool DoValidation(WizardPage page) { string message = null; if (page == wizardPageNetworkAddress) { Answers.NetworkAddress = (Answers.NetworkAddress ?? "").Trim(); if (Answers.NetworkAddress == "") { message = Strings.DataSourceNetworkAddressMissing; } else { var currentCursor = Cursor.Current; Cursor = Cursors.WaitCursor; try { try { var dnsLookup = Dns.GetHostEntry(Answers.NetworkAddress); if (dnsLookup == null || dnsLookup.AddressList == null || dnsLookup.AddressList.Length == 0) { message = String.Format(Strings.CannotResolveAddress, Answers.NetworkAddress); } } catch { message = Strings.CidrInvalid; } } finally { Cursor = currentCursor; } } errorProvider.SetError(textBoxNetworkAddress, message); } if (page == wizardPageWebAddress) { Answers.WebAddress = (Answers.WebAddress ?? "").Trim(); if (Answers.WebAddress == "") { message = Strings.WebAddressRequired; } else { try { if (!Uri.TryCreate(Answers.WebAddress, UriKind.Absolute, out var uri)) { message = Strings.WebAddressIsInvalid; } else { if (!String.Equals(uri.Scheme, "http", StringComparison.OrdinalIgnoreCase) && !String.Equals(uri.Scheme, "https", StringComparison.OrdinalIgnoreCase)) { message = Strings.WebAddressIsInvalid; } } } catch { message = Strings.WebAddressIsInvalid; } } errorProvider.SetError(textBoxWebAddress, message); } return(message == null); }
protected virtual void ApplyTitleMode() { string newTitle = _cachedTitle; // Calculate new title text switch (_titleMode) { case TitleModes.None: // Do nothing! break; case TitleModes.Steps: // Get the current page int selectedPage = wizardControl.SelectedIndex; int totalPages = wizardControl.WizardPages.Count; // Only need separator if some text is already present if (newTitle.Length > 0) { newTitle += " - "; } // Append the required text newTitle += "Step " + (selectedPage + 1).ToString() + " of " + totalPages.ToString(); break; case TitleModes.WizardPageTitle: // Do we have a valid page currently selected? if (wizardControl.SelectedIndex != -1) { // Get the page WizardPage wp = wizardControl.WizardPages[wizardControl.SelectedIndex]; // Only need separator if some text is already present if (newTitle.Length > 0) { newTitle += " - "; } // Append page title to the title newTitle += wp.Title; } break; case TitleModes.WizardPageSubTitle: // Do we have a valid page currently selected? if (wizardControl.SelectedIndex != -1) { // Get the page WizardPage wp = wizardControl.WizardPages[wizardControl.SelectedIndex]; // Only need separator if some text is already present if (newTitle.Length > 0) { newTitle += " - "; } // Append page sub-title to the title newTitle += wp.SubTitle; } break; case TitleModes.WizardPageCaptionTitle: // Do we have a valid page currently selected? if (wizardControl.SelectedIndex != -1) { // Get the page WizardPage wp = wizardControl.WizardPages[wizardControl.SelectedIndex]; // Only need separator if some text is already present if (newTitle.Length > 0) { newTitle += " - "; } // Append page sub-title to the title newTitle += wp.CaptionTitle; } break; } // Use base class to update actual caption bar base.Text = newTitle; }
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(); } }
public virtual bool Next(WizardPage newWizardPage) { return(true); }
public virtual bool Previous(WizardPage newWizardPage) { return(true); }
private Wizard createWizard() { Wizard wizard = new Wizard(); // Include page to select tool if (AllowToolSelection) { AvailableToolbarItemsControl toolList = new AvailableToolbarItemsControl(false) { HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Stretch, Margin = new Thickness(0, 5, 0, 0) }; WizardPage toolSelectionPage = new WizardPage() { Content = toolList, Heading = ESRI.ArcGIS.Mapping.Builder.Resources.Strings.SelectAToolToAdd }; wizard.Pages.Add(toolSelectionPage); _locallyInsertedWizardPagesCount++; toolList.SelectedItemChanged += (o, e) => { toolSelectionPage.InputValid = toolList.SelectedToolItemType != null; // If a new command is selected, rebuild the wizard pages if (toolSelectionPage.InputValid && toolList.SelectedClass != null && !toolList.SelectedClass.Equals(Class)) { // Remove pages collection changed handler from previously selected tool ISupportsWizardConfiguration previousWizardConfigInterface = Class as ISupportsWizardConfiguration; if (previousWizardConfigInterface != null) { previousWizardConfigInterface.Pages.CollectionChanged -= WizardInterfacePages_CollectionChanged; } Class = toolList.SelectedClass; DisplayInfo = toolList.SelectedItemDisplayInfo; // All but the page showing the available tools will be removed, so reset the number of // pages added to the wizard by the command to one. _locallyInsertedWizardPagesCount = 1; List <WizardPage> configPages = createWizardPages(); int pagesToRemove = wizard.Pages.Count - 1; // Add the new config pages to the wizard, then remove the old ones foreach (WizardPage page in configPages) { wizard.Pages.Add(page); } for (int i = 0; i < pagesToRemove; i++) { wizard.Pages.RemoveAt(1); } updateConfigureButton(wizard); // Initialize CurrentPage if command implements ISupportsWizardConfiguration ISupportsWizardConfiguration wizardConfigInterface = Class as ISupportsWizardConfiguration; if (wizardConfigInterface != null) { wizardConfigInterface.Pages.CollectionChanged += WizardInterfacePages_CollectionChanged; wizardConfigInterface.CurrentPage = toolSelectionPage; } } }; Size maxPageSize = getMaxPageSize(toolList.AvailableItems); if (maxPageSize.Height > 0 && maxPageSize.Width > double.MinValue) { wizard.ContentHeight = maxPageSize.Height; wizard.ContentWidth = maxPageSize.Width > 400 ? maxPageSize.Width : 400; } } else { // Get wizard config interface and use to initialize wizard size ISupportsWizardConfiguration wizardConfigInterface = Class as ISupportsWizardConfiguration; if (wizardConfigInterface != null) { wizard.ContentHeight = wizardConfigInterface.DesiredSize.Height; wizard.ContentWidth = wizardConfigInterface.DesiredSize.Width; wizardConfigInterface.Pages.CollectionChanged += WizardInterfacePages_CollectionChanged; } } // initialize wizard pages List <WizardPage> pages = createWizardPages(); foreach (WizardPage page in pages) { wizard.Pages.Add(page); } updateConfigureButton(wizard); // Wire events wizard.PageChanging += Wizard_PageChanging; wizard.PageChanged += Wizard_PageChanged; wizard.Cancelled += Wizard_Cancelled; wizard.Completed += Wizard_Completed; return(wizard); }
private void projectMigrationWizzard_BeforeSwitchPages(object sender, CristiPotlog.Controls.Wizard.BeforeSwitchPagesEventArgs e) { // get wizard page already displayed WizardPage oldPage = projectMigrationWizzard.Pages[e.OldIndex]; // check if we're going forward from options page if (oldPage == fromStudioVersion && e.NewIndex > e.OldIndex) { var selectedStudioVersionsGeneric = chkSourceStudioVersions.CheckedObjects; if (selectedStudioVersionsGeneric.Count == 0) { MessageBox.Show(this, Resources .MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_a_Studio_version_, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Select_a_studio_version, MessageBoxButtons.OK); e.Cancel = true; return; } if (selectedStudioVersionsGeneric.Count > 1) { MessageBox.Show(this, Resources .MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_only_one_version, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Only_one_version , MessageBoxButtons.OK); e.Cancel = true; return; } } if (oldPage == toStudioVersion && e.NewIndex > e.OldIndex) { var selectedDestinationStudioVersionsGeneric = chkDestinationStudioVersion.CheckedObjects; if (selectedDestinationStudioVersionsGeneric.Count == 0) { MessageBox.Show(this, Resources .MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_a_Studio_version_, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Select_a_studio_version, MessageBoxButtons.OK); e.Cancel = true; return; } if (selectedDestinationStudioVersionsGeneric.Count > 1) { MessageBox.Show(this, Resources .MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_only_one_version, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Only_one_version , MessageBoxButtons.OK); e.Cancel = true; return; } var selectedSourceStudioVersionsGeneric = chkSourceStudioVersions.CheckedObjects; var destinationStudioVersion = (StudioVersion)selectedDestinationStudioVersionsGeneric[0]; var sourceStudioVersion = (StudioVersion)selectedSourceStudioVersionsGeneric[0]; if (destinationStudioVersion.Equals(selectedSourceStudioVersionsGeneric[0])) { MessageBox.Show(this, string.Format("Destination version ({0}) must be different than the source version ({1})", destinationStudioVersion.PublicVersion, sourceStudioVersion.PublicVersion), Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Same_version , MessageBoxButtons.OK); e.Cancel = true; return; } var migrateProjects = new MigrateProjectsService(sourceStudioVersion, destinationStudioVersion); var selectAllProjects = new Project { Name = "Select all projects" }; var projects = migrateProjects.GetProjectsToBeMigrated(); if (projects.Count != 0 && projects.Count != 1) { projects.Insert(0, selectAllProjects); } projectsToBeMoved.SetObjects(projects); foreach (OLVListItem item in from OLVListItem item in projectsToBeMoved.Items let project = (Project)item.RowObject where !Path.IsPathRooted(project.ProjectFilePath) select item) { if (item.Text != @"Select all projects") { item.Checked = true; } } projectsToBeMoved.ItemChecked += ProjectsToBeMoved_ItemChecked; if (projectsToBeMoved.Items.Count > 0) { if (projectsToBeMoved.Items[0].Text == @"Select all projects") { projectsToBeMoved.Items[0].ForeColor = ColorTranslator.FromHtml("#6887B2"); projectsToBeMoved.Items[0].Font = new Font(projectsToBeMoved.Items[0].Font, FontStyle.Bold); } } } #region Plugins page if (oldPage == moveProjects && e.NewIndex > e.OldIndex) { //call Sdl.Community.PluginInfo.dll in order to get the plugin name var currentAssembly = Assembly.GetAssembly(typeof(MigrateProjectsService)); var path = Path.GetDirectoryName(currentAssembly.Location); if (path != null) { var pluginInfoDll = Assembly.LoadFrom(Path.Combine(path, "Sdl.Community.PluginInfo")); var type = pluginInfoDll.GetType("Sdl.Community.PluginInfo.PluginPackageInfo"); var selectedSourceStudioVersionsGeneric = chkSourceStudioVersions.CheckedObjects; var sourceStudioVersion = (StudioVersion)selectedSourceStudioVersionsGeneric[0]; var selectedDestinationStudioVersionsGeneric = chkDestinationStudioVersion.CheckedObjects; var destinationStudioVersion = (StudioVersion)selectedDestinationStudioVersionsGeneric[0]; //get plugins list for source selected studio version var sourcePluginsList = GetInstallledPluginsForSpecificStudioVersion(sourceStudioVersion); //get plugins list for destination selected studio version var destinationPluginsPathList = GetInstallledPluginsForSpecificStudioVersion(destinationStudioVersion); //check if there are any plugins to be migrated for selected verions var pluginsList = sourcePluginsList.Where(p => destinationPluginsPathList.All(d => d.PluginName != p.PluginName)); //call "GetPluginName" method in order to get the plugin name var method = type.GetMethod("GetPluginName"); var constructor = type.GetConstructor( BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); var instance = constructor.Invoke(new object[] { }); foreach (var plugin in pluginsList) { var name = method.Invoke(instance, new object[] { plugin.Path }); var pluginToBeMoved = new Model.PluginInfo { Path = plugin.Path, PluginName = name as string }; if (!_pluginsToBeMigrated.Exists(p => p.PluginName == pluginToBeMoved.PluginName)) { _pluginsToBeMigrated.Add(pluginToBeMoved); } } } var selectAllPlugins = new Model.PluginInfo { PluginName = "Select all plugins" }; if (_pluginsToBeMigrated.Count > 1 && !_pluginsToBeMigrated.Exists(p => p.PluginName == selectAllPlugins.PluginName)) { _pluginsToBeMigrated.Insert(0, selectAllPlugins); } installedPluginsListView.SetObjects(_pluginsToBeMigrated); installedPluginsListView.ItemChecked += InstalledPluginsListView_ItemChecked; if (installedPluginsListView.Items.Count > 0) { if (installedPluginsListView.Items[0].Text == @"Select all plugins") { installedPluginsListView.Items[0].ForeColor = ColorTranslator.FromHtml("#6887B2"); installedPluginsListView.Items[0].Font = new Font(installedPluginsListView.Items[0].Font, FontStyle.Bold); } } } #endregion }
// <summary> // Allows creation of a definition that is composed of a new WizardPage // </summary> internal WizardPageDefinition(WizardPage wizardPage) { WizardPage = wizardPage; }
private void SetAllowProperties(WizardPage page, bool value) { page.AllowNext = value; page.AllowPrevious = value; page.AllowCancel = value; }
private async void LoadFromButton_Click(object sender, System.Windows.RoutedEventArgs e) { var openFileDialog = new OpenFileDialog { Filter = "Texture Files(*.ttmp2)|*.ttmp2", InitialDirectory = Settings.Default.ModPack_Directory }; if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } var ttmp = new TTMP(new DirectoryInfo(Settings.Default.ModPack_Directory), XivStrings.TexTools); var ttmpData = await ttmp.GetModPackJsonData(new DirectoryInfo(openFileDialog.FileName)); if (!ttmpData.ModPackJson.TTMPVersion.Contains("w")) { FlexibleMessageBox.Show(new Wpf32Window(this), UIMessages.NotWizardModPack, UIMessages.ModPackLoadingTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var tempMPD = Path.GetTempFileName(); using (var archive = ZipFile.OpenRead(openFileDialog.FileName)) { using (var zipStream = archive.GetEntry("TTMPD.mpd").Open()) { using (var fileStream = new FileStream(tempMPD, FileMode.OpenOrCreate)) { await zipStream.CopyToAsync(fileStream); } } } this.ModPackAuthor.Text = ttmpData.ModPackJson.Author; this.ModPackName.Text = ttmpData.ModPackJson.Name; this.ModPackVersion.Text = ttmpData.ModPackJson.Version; this.ModPackDescription.Text = ttmpData.ModPackJson.Description; for (var i = modPackWizard.Items.Count - 1; i > 0; i--) { modPackWizard.Items.RemoveAt(i); } //var previousPage = modPackWizard.CurrentPage; foreach (var wizPageItemJson in ttmpData.ModPackJson.ModPackPages) { var wizPage = new WizardPage(); wizPage.Background = null; wizPage.HeaderBackground = null; var wizModPackControl = new WizardModPackControl(); wizPage.Content = wizModPackControl; wizPage.PageType = WizardPageType.Blank; foreach (var groupJson in wizPageItemJson.ModGroups) { var modGroup = new ModGroup(); modGroup.OptionList = new List <ModOption>(); modGroup.GroupName = groupJson.GroupName; modGroup.SelectionType = groupJson.SelectionType; wizModPackControl.ModGroupList.Add(modGroup); wizModPackControl.ModGroupNames.Add(modGroup.GroupName); foreach (var optionJson in groupJson.OptionList) { var modOption = new ModOption(); modGroup.OptionList.Add(modOption); modOption.Name = optionJson.Name; modOption.GroupName = optionJson.GroupName; modOption.IsChecked = optionJson.IsChecked; modOption.SelectionType = optionJson.SelectionType; modOption.Description = optionJson.Description; if (optionJson.ImagePath.Length > 0) { using (var zipFile = ZipFile.OpenRead(openFileDialog.FileName)) { using (var stream = zipFile.GetEntry(optionJson.ImagePath).Open()) { var tmpImage = Path.GetTempFileName(); using (var imageStream = File.Open(tmpImage, FileMode.OpenOrCreate)) { await stream.CopyToAsync(imageStream); imageStream.Position = 0; } var fileNameBak = openFileDialog.FileName; openFileDialog.FileName = tmpImage; modOption.Image = Image.Load(openFileDialog.FileName); modOption.ImageFileName = openFileDialog.FileName; openFileDialog.FileName = fileNameBak; } } } foreach (var modJson in optionJson.ModsJsons) { var modData = new ModData(); modData.Category = modJson.Category; modData.FullPath = modJson.FullPath; modData.Name = modJson.Name; using (var br = new BinaryReader(File.OpenRead(tempMPD))) { br.BaseStream.Seek(modJson.ModOffset, SeekOrigin.Begin); modData.ModDataBytes = br.ReadBytes(modJson.ModSize); } modOption.Mods.Add(modData.FullPath, modData); } ((List <ModOption>)wizModPackControl.OptionsList.ItemsSource).Add(modOption); var view = (CollectionView)CollectionViewSource.GetDefaultView(wizModPackControl.OptionsList.ItemsSource); var groupDescription = new PropertyGroupDescription("GroupName"); view.GroupDescriptions.Clear(); view.GroupDescriptions.Add(groupDescription); } if (modGroup.OptionList.Count > 0 && modGroup.OptionList.Count(it => it.IsChecked) == 0) { modGroup.OptionList[0].IsChecked = true; } } modPackWizard.Items.Add(wizPage); modPackWizard.CanHelp = true; } modPackWizard.Items.Add(new WizardPage() { Content = new WizardModPackControl(), PageType = WizardPageType.Blank, Background = null, HeaderBackground = null }); }
public WizardPageEventArgs(WizardPage page) { _page = page; }
/// <summary> /// Event handler for next page /// </summary> private void modPackWizard_Next(object sender, Xceed.Wpf.Toolkit.Core.CancelRoutedEventArgs e) { var wizPages = modPackWizard.Items; var verString = ModPackVersion.Text.Replace("_", "0"); if (verString.Contains(",")) { verString = verString.Replace(",", "."); } char[] invalidChars = { '/', '\\', ':', '*', '?', '"', '<', '>', '|' }; if (ModPackName.Text.IndexOfAny(invalidChars) >= 0) { if (FlexibleMessageBox.Show(new Wpf32Window(this), UIMessages.InvalidCharacterModpackNameMessage, UIMessages.InvalidCharacterModpackNameTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.OK) { e.Cancel = true; return; } } VersionNumber = Version.Parse(verString); if (VersionNumber.ToString().Equals("0.0.0")) { if (FlexibleMessageBox.Show(new Wpf32Window(this), UIMessages.DefaultModPackVersionMessage, UIMessages.NoVersionFoundTitle, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.OK) { VersionNumber = new Version(1, 0, 0); } else { e.Cancel = true; return; } } if (ModPackAuthor.Text.Equals(string.Empty)) { if (FlexibleMessageBox.Show(new Wpf32Window(this), UIMessages.DefaultModPackAuthorMessage, UIMessages.NoAuthorFoundTitle, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.OK) { ModPackAuthor.Text = "TexTools User"; } else { e.Cancel = true; return; } } if (ModPackDescription.Text.Equals(string.Empty)) { if (FlexibleMessageBox.Show(new Wpf32Window(this), UIMessages.DefaultDescriptionMessage, UIMessages.NoDescriptionFoundTitle, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Cancel) { e.Cancel = true; return; } } var index = wizPages.IndexOf(modPackWizard.CurrentPage); if (index == wizPages.Count - 2) { var newPage = new WizardPage { Content = new WizardModPackControl(), PageType = WizardPageType.Blank, Background = null, HeaderBackground = null }; wizPages.Add(newPage); } modPackWizard.CanHelp = true; }
/// <summary> /// Inserts an element into the WizardPagesCollection at the specified index. /// </summary> /// <param name="index">An Integer value representing the zero-based index at which value should be inserted.</param> /// <param name="value">A WizardPage object to insert. The value can be null.</param> public void Insert( int index, WizardPage value ) { // insert the item List.Insert(index, value ); }
/// <summary> /// Determines whether an element is in the WizardPagesCollection. /// </summary> /// <param name="value">The WizardPage object to locate. The value can be null.</param> /// <returns>true if item is found in the WizardPagesCollection; otherwise, false.</returns> public bool Contains(WizardPage value) { return List.Contains(value); }
public void Remove(WizardPage value) { // Use base class to process actual collection operation base.List.Remove(value as object); }
public bool PageChanging() { // Store reference to current wizard page before page changes lastPage = CurrentPage; return(true); }
public void Insert(int index, WizardPage value) { // Use base class to process actual collection operation base.List.Insert(index, value as object); }
/// <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); }
public bool Contains(WizardPage value) { // Use base class to process actual collection operation return(base.List.Contains(value as object)); }
public int IndexOf(WizardPage value) { // Find the 0 based index of the requested entry return(base.List.IndexOf(value)); }
private void BtnBACK_Click(object sender, EventArgs e) { TbCntrlMain.SelectedIndex = 1; WizardPage.FocusData(); }
private void projectMigrationWizzard_BeforeSwitchPages(object sender, CristiPotlog.Controls.Wizard.BeforeSwitchPagesEventArgs e) { // get wizard page already displayed WizardPage oldPage = projectMigrationWizzard.Pages[e.OldIndex]; // check if we're going forward from options page if (oldPage == fromStudioVersion && e.NewIndex > e.OldIndex) { var selectedStudioVersionsGeneric = chkSourceStudioVersions.CheckedObjects; if (selectedStudioVersionsGeneric.Count == 0) { MessageBox.Show(this, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_a_Studio_version_, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Select_a_studio_version, MessageBoxButtons.OK); e.Cancel = true; return; } if (selectedStudioVersionsGeneric.Count > 1) { MessageBox.Show(this, Resources .MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_only_one_version, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Only_one_version , MessageBoxButtons.OK); e.Cancel = true; return; } } if (oldPage == toStudioVersion && e.NewIndex > e.OldIndex) { var selectedDestinationStudioVersionsGeneric = chkDestinationStudioVersion.CheckedObjects; if (selectedDestinationStudioVersionsGeneric.Count == 0) { MessageBox.Show(this, Resources .MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_a_Studio_version_, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Select_a_studio_version, MessageBoxButtons.OK); e.Cancel = true; return; } if (selectedDestinationStudioVersionsGeneric.Count > 1) { MessageBox.Show(this, Resources .MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Please_select_only_one_version, Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Only_one_version , MessageBoxButtons.OK); e.Cancel = true; return; } var selectedSourceStudioVersionsGeneric = chkSourceStudioVersions.CheckedObjects; var destinationStudioVersion = (StudioVersion)selectedDestinationStudioVersionsGeneric[0]; var sourceStudioVersion = (StudioVersion)selectedSourceStudioVersionsGeneric[0]; if (destinationStudioVersion.Equals(selectedSourceStudioVersionsGeneric[0])) { MessageBox.Show(this, string.Format("Destination version ({0}) must be different than the source version ({1})", destinationStudioVersion.PublicVersion, sourceStudioVersion.PublicVersion), Resources.MigrateProjects_projectMigrationWizzard_BeforeSwitchPages_Same_version , MessageBoxButtons.OK); e.Cancel = true; return; } var migrateProjects = new MigrateProjectsService(sourceStudioVersion, destinationStudioVersion); var projects = migrateProjects.GetProjectsToBeMigrated(); projectsToBeMoved.SetObjects(projects); foreach (OLVListItem item in from OLVListItem item in projectsToBeMoved.Items let project = (Project)item.RowObject where !Path.IsPathRooted(project.ProjectFilePath) select item) { item.Checked = true; } } }
public void MoveToPage(WizardPage page) { this.currentPage = page; }
public ProgressPageBehavior(WizardPage page) { this.page = page; }
public void SetPageState(WizardPage page, bool enabled) { this.pageState[page.ToString()] = enabled; }
/// <summary> /// Displays the next wizard dialog. /// </summary> internal static void NextStep() { LibCommunications.gAddLog(String.Format("Moving to next step, {0} to {1} (of {2} total)", CurrentStep, CurrentStep + 1, StepsToRun.Length)); Form form; CurrentStep++; if (CurrentStep == StepsToRun.Length) { form = new FinalPage(Program.Settings.TranslationProvider); #if !FULL_TOOLSET Program.NextForm = form as WizardPage; #else form.Show(MainForm); #endif return; } form = CreateStep(); #if !FULL_TOOLSET Program.NextForm = form as WizardPage; #else form.Show(Program.MainForm); #endif }
public bool GetPageState(WizardPage page) { return(this.pageState[page.ToString()]); }
private static void RunApplication(string[] arguments) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); processArguments(arguments); MigrateFiles("Languages", "*.txt", "Languages", false); Settings = Settings.Load(SettingsFile); SelectedSteps = Settings.LastSelectedSteps; // Load the translations. Lib.SetCommunicationsObject(LibCommunications.GetInstance()); Settings.LoadTranslations(); MigrateDataFiles(); #if FULL_TOOLSET LoadedAssemblyModules = new List<AssemblyInfo>(); string ToolsDirectory = Settings.MakeDirectory("Tools"); ToolList = ModuleLoader<ToolInfo>.LoadAll( new string[] { ToolsDirectory, "Tools" }, "*.dll"); MainForm = new MainForm(Settings.TranslationProvider); Application.Run(MainForm); #else NextForm = new Welcome(Program.Settings.TranslationProvider); while (NextForm != null) { Application.Run(NextForm); } #endif }
private void RegisterWizardPage(Page formName, WizardPage form) { m_wizardPages.Add(formName, form); }
public HelpAwareWizardPage( IKeyboardEditorRoot root, WizardManager wizardManager, WizardPage next, bool isLastStep, string title = "" ) : base(wizardManager, next, title) { Root = root; }
private static IWizardPage GetWizardPage(WizardPage page) { return(page.ContentArea.Controls[0] as IWizardPage); }
/// <summary> /// Searches for the specified WizardPage and returns the zero-based index /// of the first occurrence in the entire WizardPagesCollection. /// </summary> /// <param name="value">A WizardPage object to locate in the WizardPagesCollection. /// The value can be null.</param> /// <returns></returns> public int IndexOf(WizardPage value) { return List.IndexOf(value); }
protected override IEnumerator <WizardPage> GetPages() { var extruderCount = printer.Settings.GetValue <int>(SettingsKey.extruder_count); var levelingStrings = new LevelingStrings(); var title = "Unload Material".Localize(); var instructions = "Please select the material you want to unload.".Localize(); if (extruderCount > 1) { instructions = "Please select the material you want to unload from extruder {0}.".Localize().FormatWith(extruderIndex + 1); } // select the material yield return(new SelectMaterialPage(this, title, instructions, "Unload".Localize(), extruderIndex, false, false) { WindowTitle = Title }); var theme = ApplicationController.Instance.Theme; // wait for extruder to heat { var targetHotendTemp = printer.Settings.Helpers.ExtruderTargetTemperature(extruderIndex); var temps = new double[4]; temps[extruderIndex] = targetHotendTemp; yield return(new WaitForTempPage( this, "Waiting For Printer To Heat".Localize(), (extruderCount > 1 ? "Waiting for hotend {0} to heat to ".Localize().FormatWith(extruderIndex + 1) : "Waiting for the hotend to heat to ".Localize()) + targetHotendTemp + "°C.\n" + "This will ensure that filament is able to flow through the nozzle.".Localize() + "\n" + "\n" + "Warning! The tip of the nozzle will be HOT!".Localize() + "\n" + "Avoid contact with your skin.".Localize(), 0, temps)); } var extrusionMultiplierStream = printer.Connection.ExtrusionMultiplierStream; var oldExtrusionMultiplier = extrusionMultiplierStream.ExtrusionRatio; // show the unloading filament progress bar { int extruderPriorToUnload = printer.Connection.ActiveExtruderIndex; RunningInterval runningGCodeCommands = null; var unloadingFilamentPage = new WizardPage(this, "Unloading Filament".Localize(), "") { PageLoad = (page) => { extrusionMultiplierStream.ExtrusionRatio = 1; page.NextButton.Enabled = false; // add the progress bar var holder = new FlowLayoutWidget() { Margin = new BorderDouble(3, 0, 0, 10), }; var progressBar = new ProgressBar(150 * GuiWidget.DeviceScale, 15 * GuiWidget.DeviceScale) { FillColor = theme.PrimaryAccentColor, BorderColor = theme.TextColor, BackgroundColor = Color.White, VAnchor = VAnchor.Center, }; var progressBarText = new TextWidget("", pointSize: 10, textColor: theme.TextColor) { AutoExpandBoundsToText = true, Margin = new BorderDouble(5, 0, 0, 0), VAnchor = VAnchor.Center, }; holder.AddChild(progressBar); holder.AddChild(progressBarText); page.ContentRow.AddChild(holder); if (extruderCount > 1) { // reset the extruder that was active printer.Connection.QueueLine($"T{extruderIndex}"); } // reset the extrusion amount so this is easier to debug printer.Connection.QueueLine("G92 E0"); // Allow extrusion at any temperature. S0 only works on Marlin S1 works on repetier and marlin printer.Connection.QueueLine("M302 S1"); // send a dwell to empty out the current move commands printer.Connection.QueueLine("G4 P1"); // put in a second one to use as a signal for the first being processed printer.Connection.QueueLine("G4 P1"); // start heating up the extruder if (extruderIndex == 0) { printer.Connection.SetTargetHotendTemperature(0, printer.Settings.GetValue <double>(SettingsKey.temperature)); } else { printer.Connection.SetTargetHotendTemperature(extruderIndex, printer.Settings.GetValue <double>(SettingsKey.temperature + extruderIndex.ToString())); } var loadingSpeedMmPerS = printer.Settings.GetValue <double>(SettingsKey.load_filament_speed); var unloadLengthMm = Math.Max(1, printer.Settings.GetValue <double>(SettingsKey.unload_filament_length)); var remainingLengthMm = unloadLengthMm; var maxSingleExtrudeLength = 20; Stopwatch runningTime = null; var expectedTimeS = unloadLengthMm / loadingSpeedMmPerS; double currentE = 0; runningGCodeCommands = UiThread.SetInterval(() => { // wait until the printer has processed all our commands (including G92) if (printer.Connection.NumQueuedCommands == 0) { if (runningTime == null) { runningTime = Stopwatch.StartNew(); } if (progressBar.RatioComplete < 1 || remainingLengthMm >= .001) { var thisExtrude = Math.Min(remainingLengthMm, maxSingleExtrudeLength); currentE = printer.Connection.CurrentExtruderDestination; printer.Connection.QueueLine("G1 E{0:0.###} F{1}".FormatWith(currentE - thisExtrude, loadingSpeedMmPerS * 60)); // make sure we wait for this command to finish so we can cancel the unload at any time without delay printer.Connection.QueueLine("G4 P1"); remainingLengthMm -= thisExtrude; var elapsedSeconds = runningTime.Elapsed.TotalSeconds; progressBar.RatioComplete = Math.Min(1, elapsedSeconds / expectedTimeS); progressBarText.Text = $"Unloading Filament: {Math.Max(0, expectedTimeS - elapsedSeconds):0}"; } } if (progressBar.RatioComplete == 1 && remainingLengthMm <= .001) { UiThread.ClearInterval(runningGCodeCommands); page.NextButton.InvokeClick(); } }, .1); }, PageClose = () => { extrusionMultiplierStream.ExtrusionRatio = oldExtrusionMultiplier; UiThread.ClearInterval(runningGCodeCommands); } }; unloadingFilamentPage.Closed += (s, e) => { UiThread.ClearInterval(runningGCodeCommands); if (extruderCount > 1) { // reset the extruder that was active printer.Connection.QueueLine($"T{extruderPriorToUnload}"); } printer.Connection.QueueLine("G92 E0"); }; yield return(unloadingFilamentPage); } // put up a success message yield return(new DoneUnloadingPage(this, extruderIndex)); }
/// <summary> /// Removes the first occurrence of a specific object from the WizardPagesCollection. /// </summary> /// <param name="value">A WizardPage object to remove. The value can be null.</param> public void Remove(WizardPage value) { // remove the item List.Remove(value); }
internal static void ApplyDefaultInnerPageStyle(WizardPage page, IDesignerHost dh, IComponentChangeService cc) { if (cc != null) cc.OnComponentChanging(page, null); page.BackColor = SystemColors.Control; if (!page.InteriorPage) { TypeDescriptor.GetProperties(page.Style)["BackColor"].SetValue(page.Style, Color.White); } if (cc != null) cc.OnComponentChanged(page, null, null, null); }
void wizardPage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e) { //int forms_visit_id = 0; //FlowLayoutPanel flpanel = (FlowLayoutPanel)e.Page.Controls[FlowPanelName]; //RadioButton rb = new RadioButton(); if (1 != 0) { page_index++; //if ((page_index >= 3) && (page_index % 2 == 1)) // a = true; //if ((page_index >= 4) && (page_index % 2 == 0) && a) //{ // page_index = page_index - 1; // a = false; //} wizardControl.Pages[page_index].Text = page_index.ToString(); wizardControl.Pages[page_index].Commit += wizardPage_Commit; //wizardControl.Pages[page_index].Initialize += wizardPage_Initialize; FlowLayoutPanel flpanel_next = new FlowLayoutPanel(); flpanel_next.FlowDirection = FlowDirection.TopDown; flpanel_next.AutoSize = true; flpanel_next.AutoSizeMode = AutoSizeMode.GrowAndShrink; flpanel_next.WrapContents = true; flpanel_next.Dock = DockStyle.Fill; flpanel_next.Name = FlowPanelName; wizardControl.Pages[page_index].Controls.Add(flpanel_next); for (int i = 0; i < 10; i++) { RadioButton box = new RadioButton(); box.Text = i.ToString(); box.AutoSize = true; box.Dock = System.Windows.Forms.DockStyle.Fill; box.Tag = i; flpanel_next.Controls.Add(box); } wizardControl.Pages[page_index].Controls.Add(flpanel_next); WizardPage page = new WizardPage(); page.Text = page_index.ToString(); wizardControl.Pages.Insert(page_index, page); wizardControl.Pages.Add(wizardControl.Pages[page_index]); //wizardControl.PreviousPage(); //wizardControl.RestartPages(); //wizardControl.NextPage(wizardControl.Pages[page_index]); } else { WizardPage finish_page = new WizardPage(); finish_page.IsFinishPage = true; wizardControl.Pages.Add(finish_page); } }
internal static void ApplyDefaultWelcomePageStyle(WizardPage page, IDesignerHost dh, IComponentChangeService cc) { DesignerTransaction dt = null; if (dh != null) dt = dh.CreateTransaction(); try { page.BackColor = Color.White; page.Style.BackColorBlend.Clear(); TypeDescriptor.GetProperties(page)["InteriorPage"].SetValue(page, false); TypeDescriptor.GetProperties(page)["BackColor"].SetValue(page, Color.White); TypeDescriptor.GetProperties(page)["CanvasColor"].SetValue(page, Color.White); TypeDescriptor.GetProperties(page.Style)["BackColor"].SetValue(page.Style, Color.White); TypeDescriptor.GetProperties(page.Style)["BackColor2"].SetValue(page.Style, Color.Empty); TypeDescriptor.GetProperties(page.Style)["BackgroundImage"].SetValue(page.Style, LoadWizardImage(eWizardImages.WelcomeDefault)); TypeDescriptor.GetProperties(page.Style)["BackgroundImagePosition"].SetValue(page.Style, eStyleBackgroundImage.TopLeft); } catch { dt.Cancel(); throw; } finally { if (dt != null && !dt.Canceled) dt.Commit(); } }
/// <summary> /// Activates the specified wizard bage. /// </summary> /// <param name="page">A WizardPage object representing the page to be activated.</param> private void ActivatePage(WizardPage page) { // validate given page if (this.pages.Contains(page) == false) { // filter out return; } // deactivate current page if (this.selectedPage != null) { this.selectedPage.Visible = false; } // activate new page this.selectedPage = page; if (this.selectedPage != null) { //Ensure that this panel displays inside the wizard this.selectedPage.Parent = this; if (this.Contains(this.selectedPage) == false) { this.Container.Add(this.selectedPage); } if (this.selectedPage.Style == WizardPageStyle.Finish) { this.buttonCancel.Text = "ȷ��"; this.buttonCancel.DialogResult = DialogResult.OK; } else { this.buttonCancel.Text = "ȡ��"; this.buttonCancel.DialogResult = DialogResult.Cancel; } //Make it fill the space this.selectedPage.SetBounds(0, 0, this.Width, this.Height - FOOTER_AREA_HEIGHT); this.selectedPage.Visible = true; this.selectedPage.BringToFront(); this.FocusFirstTabIndex(this.selectedPage); } //What should the back button say if (this.SelectedIndex > 0) { buttonBack.Enabled = true; } else { buttonBack.Enabled = false; } //What should the Next button say if (this.SelectedIndex < this.pages.Count - 1) { this.buttonNext.Enabled = true; } else { if (this.DesignMode == false) { // at runtime disable back button (we finished; there's no point going back) buttonBack.Enabled = false; } this.buttonNext.Enabled = false; } // refresh if (this.selectedPage != null) { this.selectedPage.Invalidate(); } else { this.Invalidate(); } }
/// <summary> /// Constructor. /// </summary> /// <param name="previousPage">The previous page of the wizard to return to in case of a "PageBack" event.</param> public PageDevice(WizardPage previousPage) { this.previousPage = previousPage; InitializeComponent(); }
/// <summary> /// Gets the tag for a page. /// </summary> /// <param name="page">The page to get the tag for.</param> /// <returns>The tag for the page.</returns> private static string GetPageTag(WizardPage page) { string tag = page.ToString(); return(tag); }
private void btnNext_Click(object sender, EventArgs e) { try { if (Validataions()) { if (IsStepActive(_nextStep)) { WizardPage activePage = _wizardPages[_nextStep]; if (activePage == null) { throw new Exception("Page not active"); } Dictionary <string, object> collectedValues = activePage.CollectValues(); if (!collectedValues.ContainsKey("AccountSettings.ApplicationID")) { collectedValues.Add("AccountSettings.ApplicationID", AllCollectedValues["AccountSettings.ApplicationID"]); } foreach (KeyValuePair <string, object> item in collectedValues) { if (!AllCollectedValues.ContainsKey(item.Key)) { AllCollectedValues.Add(item.Key, item.Value); } } StepCollectResponse stepCollectResponse = Collect(collectedValues); switch (stepCollectResponse.Result) { case StepResult.Next: { _nextStep = stepCollectResponse.NextStep.StepName; ActivateStep(); break; } case StepResult.Done: { GetSummary(); ActivateStep("Summary"); break; } case StepResult.HasErrors: { StringBuilder str = new StringBuilder(); foreach (KeyValuePair <string, string> error in stepCollectResponse.Errors) { str.AppendLine(string.Format("Errors:key {0} Value{1}\n", error.Key, error.Value)); } MessageBox.Show(str.ToString()); break; } default: break; } } else { MessageBox.Show("Not Active"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }