private bool SetPage(AeroWizard.WizardPage page, int flag, int flagSet)
        {
            bool set = (flagSet & flag) == flag;

            page.Suppress = !set;
            return(set);
        }
        public void WizardNavigationwizardPage2AndSourceDataLocationTextBoxHasNoText()
        {
            using (var selectedPage = new AeroWizard.WizardPage())
            {
                selectedPage.Name = "wizardPage2";
                using (var pageContainer = new AeroWizard.WizardPageContainer())
                {
                    using (var folderPathValidationLabel = new System.Windows.Forms.Label())
                    {
                        using (var sourceDataLocationTextBox = new System.Windows.Forms.TextBox())
                        {
                            using (var systemUnderTest = new ImportWizard())
                            {
                                using (var tokenSource = new CancellationTokenSource())
                                {
                                    FluentActions.Invoking(() => systemUnderTest.WizardNavigation(folderPathValidationLabel, sourceDataLocationTextBox, selectedPage, pageContainer))
                                    .Should()
                                    .NotThrow();
                                }
                            }
                        }

                        folderPathValidationLabel.Visible.Should().BeTrue();
                    }
                }
            }
        }
        public void WizardNavigationwizardPage2AndSourceDataLocationTextBoxHasText()
        {
            using (var selectedPage = new AeroWizard.WizardPage())
            {
                selectedPage.Name = "wizardPage2";
                using (var pageContainer = new AeroWizard.WizardPageContainer())
                {
                    using (var folderPathValidationLabel = new System.Windows.Forms.Label())
                    {
                        using (var sourceDataLocationTextBox = new System.Windows.Forms.TextBox())
                        {
                            sourceDataLocationTextBox.Text = "Sample text";
                            using (var systemUnderTest = new ImportWizard())
                            {
                                using (var tokenSource = new CancellationTokenSource())
                                {
                                    FluentActions.Invoking(() => systemUnderTest.WizardNavigation(folderPathValidationLabel, sourceDataLocationTextBox, selectedPage, pageContainer))
                                    .Should()
                                    .Throw <NullReferenceException>()
                                    .WithMessage("Object reference not set to an instance of an object.");
                                }
                            }
                        }

                        folderPathValidationLabel.Visible.Should().BeFalse();
                    }
                }
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.wizardControl1 = new AeroWizard.StepWizardControl();
     this.wizardPage1 = new AeroWizard.WizardPage();
     this.wizardPage3 = new AeroWizard.WizardPage();
     this.wizardPage4 = new AeroWizard.WizardPage();
     this.wizardPage5 = new AeroWizard.WizardPage();
     ((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).BeginInit();
     this.SuspendLayout();
     //
     // wizardControl1
     //
     this.wizardControl1.BackColor = System.Drawing.Color.White;
     this.wizardControl1.ClassicStyle = AeroWizard.WizardClassicStyle.Automatic;
     this.wizardControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.wizardControl1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.wizardControl1.Location = new System.Drawing.Point(0, 0);
     this.wizardControl1.Name = "wizardControl1";
     this.wizardControl1.Pages.Add(this.wizardPage1);
     this.wizardControl1.Pages.Add(this.wizardPage3);
     this.wizardControl1.Pages.Add(this.wizardPage4);
     this.wizardControl1.Pages.Add(this.wizardPage5);
     this.wizardControl1.Size = new System.Drawing.Size(768, 482);
     this.wizardControl1.StepListFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
     this.wizardControl1.TabIndex = 0;
     //
     // wizardPage1
     //
     this.wizardPage1.Name = "wizardPage1";
     this.wizardPage1.Size = new System.Drawing.Size(570, 328);
     this.wizardControl1.SetStepText(this.wizardPage1, "Page 1");
     this.wizardPage1.TabIndex = 0;
     this.wizardPage1.Text = "Page 1";
     //
     // wizardPage3
     //
     this.wizardPage3.Name = "wizardPage3";
     this.wizardPage3.Size = new System.Drawing.Size(570, 328);
     this.wizardControl1.SetStepText(this.wizardPage3, "Page 3");
     this.wizardPage3.TabIndex = 2;
     this.wizardPage3.Text = "Page 3";
     //
     // wizardPage4
     //
     this.wizardPage4.Name = "wizardPage4";
     this.wizardPage4.Size = new System.Drawing.Size(570, 328);
     this.wizardControl1.SetStepText(this.wizardPage4, "Page 4");
     this.wizardPage4.TabIndex = 3;
     this.wizardPage4.Text = "Page 4";
     //
     // wizardPage5
     //
     this.wizardPage5.Name = "wizardPage5";
     this.wizardPage5.Size = new System.Drawing.Size(570, 328);
     this.wizardControl1.SetStepText(this.wizardPage5, "Page 5");
     this.wizardPage5.TabIndex = 4;
     this.wizardPage5.Text = "Page 5";
     //
     // MyStepWizard
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(768, 482);
     this.Controls.Add(this.wizardControl1);
     this.Name = "MyStepWizard";
     this.Text = "MyStepWizard";
     ((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).EndInit();
     this.ResumeLayout(false);
 }
Example #5
0
        public void WizardNavigation(System.Windows.Forms.Label folderPathValidationLabel, TextBox sourceDataLocationTextBox, AeroWizard.WizardPage selectedPage, AeroWizard.WizardPageContainer pageContainer)
        {
            if (selectedPage.Name == "wizardPage2")
            {
                ValidationHelpers.IsTextControlNotEmpty(folderPathValidationLabel, sourceDataLocationTextBox);

                if (!folderPathValidationLabel.Visible)
                {
                    pageContainer.NextPage();
                }
            }
            else if (!selectedPage.IsFinishPage)
            {
                pageContainer.NextPage();
            }
        }
Example #6
0
        public void Setup()
        {
            if (WizardAdapterControl._useAeroWizard)
            {
                InitializeControl = (page) =>
                {
                    _aeroPage = (AeroWizard.WizardPage)page;

                    _aeroPage.Initialize += (s, e) =>
                    {
                        if (this.Initialize != null)
                        {
                            this.Initialize(s, e);
                        }
                    };

                    GetTag            = () => _aeroPage.Tag;
                    SetTag            = (value) => _aeroPage.Tag = value;
                    GetSuppress       = () => _aeroPage.Suppress;
                    SetSuppress       = (value) => _aeroPage.Suppress = value;
                    GetAllowNext      = () => _aeroPage.AllowNext;
                    SetAllowNext      = (value) => _aeroPage.AllowNext = value;
                    GetNextPage       = () => new WizardAdapterPage(_aeroPage.NextPage);
                    SetNextPage       = (value) => _aeroPage.NextPage = value._aeroPage;
                    GetIsFinishedPage = () => _aeroPage.IsFinishPage;
                    SetIsFinishedPage = (value) => _aeroPage.IsFinishPage = value;
                    GetText           = () => _aeroPage.Text;
                    SetText           = (value) => _aeroPage.Text = value;
                    GetSize           = () => _aeroPage.Size;
                    SetSize           = (value) => _aeroPage.Size = value;
                };
            }
            else
            {
                InitializeControl = (page) =>
                {
                    _winformPage = (WinForms.WizardPage)page;

                    _winformPage.Initialize += (s, e) =>
                    {
                        if (this.Initialize != null)
                        {
                            this.Initialize(s, e);
                        }
                    };

                    GetTag            = () => _winformPage.Tag;
                    SetTag            = (value) => _winformPage.Tag = value;
                    GetSuppress       = () => _winformPage.Suppress;
                    SetSuppress       = (value) => _winformPage.Suppress = value;
                    GetAllowNext      = () => _winformPage.AllowNext;
                    SetAllowNext      = (value) => _winformPage.AllowNext = value;
                    GetNextPage       = () => new WizardAdapterPage(_winformPage.NextPage);
                    SetNextPage       = (value) => _winformPage.NextPage = value._winformPage;
                    GetIsFinishedPage = () => _winformPage.IsFinishPage;
                    SetIsFinishedPage = (value) => _winformPage.IsFinishPage = value;
                    GetText           = () => _winformPage.Text;
                    SetText           = (value) => _winformPage.Text = value;
                    GetSize           = () => _winformPage.Size;
                    SetSize           = (value) => _winformPage.Size = value;
                };
            }
        }