Exemple #1
0
        internal void SetWizardButtons(WizardButtons buttons)
        {
            // The Back button is simple.
            backButton.Enabled = ((buttons & WizardButtons.Back) != 0);

            // The Next button is a bit more complicated. If we've got a Finish button, then it's disabled and hidden.
            if ((buttons & WizardButtons.Finish) != 0)
            {
                finishButton.Visible = true;
                finishButton.Enabled = true;

                nextButton.Visible = false;
                nextButton.Enabled = false;

                this.AcceptButton = finishButton;
            }
            else
            {
                finishButton.Visible = false;
                finishButton.Enabled = false;

                nextButton.Visible = true;
                nextButton.Enabled = ((buttons & WizardButtons.Next) != 0);

                //this.AcceptButton = nextButton;
            }
        }
Exemple #2
0
        /// <summary>
        /// Returns the button style requested
        /// </summary>
        /// <param name="button"></param>
        /// <returns></returns>
        public WizardButtonStyle GetButtonStyle(WizardButtons button)
        {
            switch (button)
            {
            case WizardButtons.Help:
                return(_buttonHelp.GetStyle());

            case WizardButtons.Back:
                return(_buttonBack.GetStyle());

            case WizardButtons.Next:
                return(_buttonNext.GetStyle());

            case WizardButtons.Finish:
                return(_buttonNext.GetStyle());

            case WizardButtons.Cancel:
                return(_buttonCancel.GetStyle());

            case WizardButtons.None:
            default:
                return(new WizardButtonStyle(WizardButtons.None, false, false));
            }
            ;
        }
        public void ShowExecuteButton()
        {
            using (var systemUnderTest = new WizardButtons())
            {
                systemUnderTest.ShowExecuteButton = true;

                systemUnderTest.ShowExecuteButton.Should().BeTrue();
            }
        }
Exemple #4
0
        /// <summary>
        /// Constructs a new Master screen.
        /// </summary>
        public ScreenMaster()
        {
            // Initialize basic screen elements
            this.InitializeComponent();

            // Specify which buttons to use with this screen
            this._buttons = WizardButtons.Default;
            this._nextOnValid = false;
        }
Exemple #5
0
 internal void EnableButton(WizardButtons buttons, bool enableFlag)
 {
     if ((buttons & WizardButtons.Finish) == WizardButtons.Finish)
         finishButton.Enabled = enableFlag;
     else if ((buttons & WizardButtons.Next) == WizardButtons.Next)
         nextButton.Enabled = enableFlag;
     else if ((buttons & WizardButtons.Back) == WizardButtons.Back)
         backButton.Enabled = enableFlag;
     else if ((buttons & WizardButtons.Cancel) == WizardButtons.Cancel)
         cancelButton.Enabled = enableFlag;
 }
Exemple #6
0
 // Token: 0x060001A9 RID: 425 RVA: 0x000091A7 File Offset: 0x000073A7
 internal void PressButton(WizardButtons buttons)
 {
     if ((buttons & WizardButtons.Next) == WizardButtons.Next)
     {
         this.btnNext.PerformClick();
         return;
     }
     if ((buttons & WizardButtons.Previous) == WizardButtons.Previous)
     {
         this.btnPrevious.PerformClick();
     }
 }
        public void ExecuteActionNullExecuteActionDoesNotThrowException()
        {
            using (var systemUnderTest = new WizardButtons())
            {
                var eventArgs = new EventArgs();
                systemUnderTest.OnExecute += null;

                FluentActions.Invoking(() => systemUnderTest.ExecuteAction(eventArgs))
                .Should()
                .NotThrow();
            }
        }
        public void ShowExecuteButtonIsFinishedPageIsFalse()
        {
            using (var systemUnderTest = new WizardButtons())
            {
                systemUnderTest.PageContainer = new WizardPageContainer();
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());

                FluentActions.Invoking(() => systemUnderTest.HandleSelectedPageChanged(false))
                .Should()
                .NotThrow();
            }
        }
 public WizardButtonStyle this[WizardButtons button]
 {
     get
     {
         foreach (WizardButtonStyle bs in base.InnerList)
         {
             if (bs.Button == button)
             {
                 return(bs);
             }
         }
         return(null);
     }
 }
Exemple #10
0
        internal void SetWizardButtons(WizardButtons buttons)
        {
            // The Back button is simple.
            backButton.Enabled = ((buttons & WizardButtons.Back) != 0);

            // The Start button will be shown in one case only
            btnStart.Enabled = btnStart.Visible = ((buttons & WizardButtons.Start) != 0);

            // The Next button is a bit more complicated. If we've got a Finish button, then it's disabled and hidden.
            if ((buttons == WizardButtons.Finish) || buttons == (WizardButtons.Back | WizardButtons.Finish))
            {
                finishButton.Visible = true;
                finishButton.Enabled = true;

                btnClose.Visible = false;
                btnClose.Enabled = false;

                nextButton.Visible = false;
                nextButton.Enabled = false;

                this.AcceptButton = finishButton;
            }
            else if ((buttons == WizardButtons.Close) || buttons == (WizardButtons.Back | WizardButtons.Close) ||
                     buttons == (WizardButtons.Start | WizardButtons.Close))
            {
                btnClose.Visible = true;
                btnClose.Enabled = true;

                finishButton.Visible = false;
                finishButton.Enabled = false;

                nextButton.Visible = false;
                nextButton.Enabled = false;

                this.AcceptButton = btnClose;
            }
            else
            {
                finishButton.Visible = false;
                finishButton.Enabled = false;

                btnClose.Visible = false;
                btnClose.Enabled = false;

                nextButton.Visible = true;
                nextButton.Enabled = ((buttons & WizardButtons.Next) != 0);

                this.AcceptButton = nextButton;
            }
        }
Exemple #11
0
 internal void PressButton(WizardButtons buttons)
 {
     if ((buttons & WizardButtons.Finish) == WizardButtons.Finish)
     {
         finishButton.PerformClick();
     }
     else if ((buttons & WizardButtons.Next) == WizardButtons.Next)
     {
         nextButton.PerformClick();
     }
     else if ((buttons & WizardButtons.Back) == WizardButtons.Back)
     {
         backButton.PerformClick();
     }
 }
        public void ExecutePreviousButtonClickWithoutCustomEvent()
        {
            using (var systemUnderTest = new WizardButtons())
            {
                systemUnderTest.PageContainer = new WizardPageContainer();
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());

                var eventArgs = new EventArgs();

                FluentActions.Invoking(() => systemUnderTest.ExecutePreviousButtonClick(eventArgs))
                .Should()
                .Throw <InvalidOperationException>()
                .WithMessage("Stack empty.");
            }
        }
        public void ExecuteAction()
        {
            var customEventExecuted = false;

            using (var systemUnderTest = new WizardButtons())
            {
                var eventArgs = new EventArgs();
                systemUnderTest.OnExecute += (x, y) => { customEventExecuted = true; };

                FluentActions.Invoking(() => systemUnderTest.ExecuteAction(eventArgs))
                .Should()
                .NotThrow();

                customEventExecuted.Should().BeTrue();
            }
        }
        public void ExecuteNextButtonClickWithoutCustomEvent()
        {
            using (var systemUnderTest = new WizardButtons())
            {
                systemUnderTest.PageContainer = new WizardPageContainer();
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());

                var eventArgs = new EventArgs();

                systemUnderTest.OnCustomNextNavigation += null;

                systemUnderTest.HandleSelectedPageChanged(false);

                FluentActions.Invoking(() => systemUnderTest.ExecuteNextButtonClick(eventArgs))
                .Should()
                .NotThrow();
            }
        }
Exemple #15
0
        internal void SetWizardButtons(WizardButtons buttons)
        {
            // The Back button is simple.
            btnBack.Enabled   = ((buttons & WizardButtons.Back) != 0);
            btnCancel.Enabled = ((buttons & WizardButtons.Cancel) != 0);

            {
                btnFinish.Visible = ((buttons & WizardButtons.Finish) != 0);
                btnFinish.Enabled = ((buttons & WizardButtons.Finish) != 0);

                btnNext.Visible = true;
                btnNext.Enabled = ((buttons & WizardButtons.Next) != 0);

                buttonAbout.Visible = ((buttons & WizardButtons.About) != 0);
                buttonAbout.Enabled = ((buttons & WizardButtons.About) != 0);

                buttonOption1.Visible = ((buttons & WizardButtons.Option1) != 0);
                buttonOption1.Enabled = ((buttons & WizardButtons.Option1) != 0);

                btnNext.NotifyDefault(true);
            }
        }
        public void ExecutePreviousButtonClickWithCustomEvent()
        {
            var customEventExecuted = false;

            using (var systemUnderTest = new WizardButtons())
            {
                systemUnderTest.PageContainer = new WizardPageContainer();
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());
                systemUnderTest.PageContainer.Pages.Add(new WizardPage());

                var eventArgs = new EventArgs();

                systemUnderTest.OnCustomPreviousNavigation += (x, y) => { customEventExecuted = true; };

                systemUnderTest.HandleSelectedPageChanged(false);

                FluentActions.Invoking(() => systemUnderTest.ExecutePreviousButtonClick(eventArgs))
                .Should()
                .NotThrow();

                customEventExecuted.Should().BeTrue();
            }
        }
        /// <summary>
        /// Applies the specified style to the button
        /// </summary>
        /// <param name="style"></param>
        public void SetStyle(WizardButtonStyle style)
        {
            switch (style.Button)
            {
            case WizardButtons.Help:
            case WizardButtons.Back:
            case WizardButtons.Next:
            case WizardButtons.Finish:
            case WizardButtons.Cancel:
                this.Text = style.Button.ToString();
                break;

            case WizardButtons.None:
            default:
                this.Text = null;
                break;
            }
            ;

            this._button = style.Button;
            this.Visible = style.Visible;
            this.Enabled = style.Enabled;
        }
 protected void PressButton(WizardButtons buttons)
 {
     GetWizard().PressButton(buttons);
 }
		public WizardButtonStyle this[WizardButtons button]
		{
			get
			{
				foreach(WizardButtonStyle bs in base.InnerList)
					if (bs.Button == button)						
						return bs;
				return null;
			}
		}
		/// <summary>
		/// Initializes a new instance of the WizardButtonStyle class
		/// </summary>
		/// <param name="button">The button this style applies to</param>
		/// <param name="visible">A flag that controls the button's visibility</param>
		/// <param name="enabled">A flag that controls the button's layout</param>
		public WizardButtonStyle(WizardButtons button, bool visible, bool enabled)
		{
			_button = button;
			_visible = visible;
			_enabled = enabled;
		}
		/// <summary>
		/// Returns the button style requested
		/// </summary>
		/// <param name="button"></param>
		/// <returns></returns>
		public WizardButtonStyle GetButtonStyle(WizardButtons button)
		{
			switch(button)
			{										
			case WizardButtons.Help:
				return _buttonHelp.GetStyle();

			case WizardButtons.Back:
				return _buttonBack.GetStyle();

			case WizardButtons.Next:
				return _buttonNext.GetStyle();

			case WizardButtons.Finish:
				return _buttonNext.GetStyle();

			case WizardButtons.Cancel:
				return _buttonCancel.GetStyle();

			case WizardButtons.None:
			default:
				return new WizardButtonStyle(WizardButtons.None, false, false);
			};			
		}
Exemple #22
0
        void IWizardContext.SetButtons( WizardButtons buttons )
        {
            if( ((buttons & WizardButtons.Next) != 0) && ((buttons & WizardButtons.Finish) != 0) )
            {
                throw new ArgumentException( "Cannot specifiy both Next and Finish.", "buttons" );
            }

            _backButton.Enabled = ((buttons & WizardButtons.Back) != 0) && (_history.Count != 0);
            _nextButton.Enabled = ((buttons & WizardButtons.Next) != 0) || ((buttons & WizardButtons.Finish) != 0);
            _cancelButton.Enabled = ((buttons & WizardButtons.Cancel) != 0);

            if( (buttons & WizardButtons.Finish) != 0 )
            {
                _nextButton.Text = _finishText;
            }
            if( (buttons & WizardButtons.Next) != 0 )
            {
                _nextButton.Text = _nextText;
            }
        }
        // Token: 0x06000036 RID: 54 RVA: 0x000027E4 File Offset: 0x000009E4
        protected void PressButton(WizardButtons buttons)
        {
            SetupFormBase wizard = this.GetWizard();

            wizard.PressButton(buttons);
        }
 protected void SetWizardButtons(WizardButtons buttons)
 {
     GetWizard().SetWizardButtons(buttons);
 }
Exemple #25
0
 protected void PressButton(WizardButtons buttons)
 {
     Wizard.PressButton(buttons);
 }
		/// <summary>
		/// Applies the specified style to the button
		/// </summary>
		/// <param name="style"></param>
		public void SetStyle(WizardButtonStyle style)
		{
			switch(style.Button)
			{										
			case WizardButtons.Help:				
			case WizardButtons.Back:				
			case WizardButtons.Next:
			case WizardButtons.Finish:
			case WizardButtons.Cancel:
				this.Text = style.Button.ToString();
				break;
			case WizardButtons.None:
			default:
				this.Text = null;
				break;
			};		
			
			this._button = style.Button;
			this.Visible = style.Visible;
			this.Enabled = style.Enabled;
		}
Exemple #27
0
        internal void SetWizardButtons(WizardButtons buttons)
        {
            // The Back button is simple.
            backButton.Enabled = ((buttons & WizardButtons.Back) != 0);

            // The Next button is a bit more complicated. If we've got a Finish button, then it's disabled and hidden.
            if ((buttons & WizardButtons.Finish) != 0)
            {
                finishButton.Visible = true;
                finishButton.Enabled = true;

                nextButton.Visible = false;
                nextButton.Enabled = false;

                this.AcceptButton = finishButton;
                finishButton.Focus();
            }
            else
            {
                finishButton.Visible = false;
                finishButton.Enabled = false;

                nextButton.Visible = true;
                nextButton.Enabled = ((buttons & WizardButtons.Next) != 0);

                this.AcceptButton = nextButton;
                nextButton.Focus();
            }

            // Show the Cancel button only if explicitly specified.
            cancelButton.Visible = (buttons & WizardButtons.Cancel) != 0;
            this.CancelButton = cancelButton;
        }
Exemple #28
0
 // Token: 0x060001A1 RID: 417 RVA: 0x0000911A File Offset: 0x0000731A
 internal void SetVisibleWizardButtons(WizardButtons buttons)
 {
     this.btnPrevious.Visible = ((buttons & WizardButtons.Previous) != WizardButtons.None);
     this.btnNext.Visible     = ((buttons & WizardButtons.Next) != WizardButtons.None);
 }
Exemple #29
0
 protected void SetWizardButtons(WizardButtons buttons)
 {
     Wizard.SetWizardButtons(buttons);
 }
 internal void PressButton(WizardButtons buttons)
 {
     if ((buttons & WizardButtons.Finish) == WizardButtons.Finish)
         finishButton.PerformClick();
     else if ((buttons & WizardButtons.Next) == WizardButtons.Next)
         nextButton.PerformClick();
     else if ((buttons & WizardButtons.Back) == WizardButtons.Back)
         backButton.PerformClick();
 }
Exemple #31
0
 protected void SetWizardButtons(WizardButtons buttons)
 {
     GetWizard().SetWizardButtons(buttons);
 }
		/// <summary>
		/// Initializes a new instance of the WizardPageButtonStyleAttribute class
		/// </summary>
		/// <param name="supportedStyles">A combination of styles that the Wizard Page supports</param>
		public WizardPageButtonStyleAttribute(WizardButtons button, bool visible, bool enabled) : base()
		{
			_style = new WizardButtonStyle(button, visible, enabled);
		}
 /// <summary>
 /// Initializes a new instance of the WizardButtonStyle class
 /// </summary>
 /// <param name="button">The button this style applies to</param>
 /// <param name="visible">A flag that controls the button's visibility</param>
 /// <param name="enabled">A flag that controls the button's layout</param>
 public WizardButtonStyle(WizardButtons button, bool visible, bool enabled)
 {
     _button  = button;
     _visible = visible;
     _enabled = enabled;
 }
Exemple #34
0
 /// <summary>
 /// Initializes a new instance of the WizardPageButtonStyleAttribute class
 /// </summary>
 /// <param name="supportedStyles">A combination of styles that the Wizard Page supports</param>
 public WizardPageButtonStyleAttribute(WizardButtons button, bool visible, bool enabled) : base()
 {
     _style = new WizardButtonStyle(button, visible, enabled);
 }
        // Token: 0x0600002D RID: 45 RVA: 0x000026E8 File Offset: 0x000008E8
        protected void SetVisibleWizardButtons(WizardButtons buttons)
        {
            SetupFormBase wizard = this.GetWizard();

            wizard.SetVisibleWizardButtons(buttons);
        }
Exemple #36
0
 protected void PressButton(WizardButtons buttons)
 {
     GetWizard().PressButton(buttons);
 }
Exemple #37
0
 // Token: 0x060001A0 RID: 416 RVA: 0x000090E4 File Offset: 0x000072E4
 internal void SetWizardButtons(WizardButtons buttons)
 {
     this.btnPrevious.Enabled = ((buttons & WizardButtons.Previous) != WizardButtons.None);
     this.btnNext.Enabled     = ((buttons & WizardButtons.Next) != WizardButtons.None);
     base.AcceptButton        = this.btnNext;
 }
        internal void SetWizardButtons(WizardButtons buttons)
        {
            // The Back button is simple.
            backButton.Enabled = ((buttons & WizardButtons.Back) != 0);

            // The Next button is a bit more complicated. If we've got a Finish button, then it's disabled and hidden.
            if ((buttons & WizardButtons.Finish) != 0)
            {
                finishButton.Visible = true;
                finishButton.Enabled = true;

                nextButton.Visible = false;
                nextButton.Enabled = false;

                this.AcceptButton = finishButton;
            }
            else
            {
                finishButton.Visible = false;
                finishButton.Enabled = false;

                nextButton.Visible = true;
                nextButton.Enabled = ((buttons & WizardButtons.Next) != 0);

                this.AcceptButton = nextButton;
            }
        }
Exemple #39
0
 protected void EnableWizardButton(WizardButtons button, bool enableFlag)
 {
     GetWizard().EnableButton(button, enableFlag);
 }