Esempio n. 1
0
        /// <Summary>
        /// EnableCommand allows a Wizard to Enable/Disable any of the four Command options
        /// </Summary>
        /// <Param name="cmd">The WizardCommand to Enable/Display</Param>
        /// <Param name="enable">
        /// A flag that determines whether the Commadn is Enabled (true) or Disabled (False)
        /// </Param>
        public void EnableCommand(WizardCommand cmd, bool enable)
        {
            switch (cmd)
            {
            case WizardCommand.Cancel:

                cmdCancel.Enabled = enable;
                break;

            case WizardCommand.Finish:

                cmdFinish.Enabled = enable;
                break;

            case WizardCommand.NextPage:

                cmdNext.Enabled = enable;
                break;

            case WizardCommand.PreviousPage:

                cmdBack.Enabled = enable;
                break;
            }
        }
 public void then_throws_an_argument_exception()
 {
     var command = new WizardCommand(
         new WizardCommandAttribute(typeof(WizardCommand))
     {
         WizardType = typeof(string)
     },
         UIServiceMock.Object,
         resolver.Object
         );
 }
        protected override void Arrange()
        {
            base.Arrange();

            UIServiceMock.Setup(x => x.ShowDialog(It.IsAny <WizardView>()))
            .Callback((Window w) => { viewCreated = w; })
            .Returns(true).Verifiable("ShowDialog not invoked.");

            resolver = new Mock <IResolver <WizardModel> >();
            resolver.Setup(x => x.Resolve(It.Is <Type>(t => t == typeof(MockWizard))))
            .Returns(new MockWizard(UIServiceMock.Object))
            .Verifiable("IResolver not invoked");

            command = new WizardCommand(
                new WizardCommandAttribute(typeof(WizardCommand))
            {
                WizardType = typeof(MockWizard)
            },
                UIServiceMock.Object,
                resolver.Object
                );
        }
Esempio n. 4
0
        /// <Summary>
        /// EnableCommand allows a Wizard to Enable/Disable any of the four Command options
        /// </Summary>
        /// <Param name="cmd">The WizardCommand to Enable/Display</Param>
        /// <Param name="enable">
        /// A flag that determines whether the Commadn is Enabled (true) or Disabled (False)
        /// </Param>
        public void EnableCommand( WizardCommand cmd, bool enable )
        {
            switch (cmd)
            {
                case WizardCommand.Cancel:

                    cmdCancel.Enabled = enable;
                    break;
                case WizardCommand.Finish:

                    cmdFinish.Enabled = enable;
                    break;
                case WizardCommand.NextPage:

                    cmdNext.Enabled = enable;
                    break;
                case WizardCommand.PreviousPage:

                    cmdBack.Enabled = enable;
                    break;
            }
        }