コード例 #1
0
ファイル: WizardForm.cs プロジェクト: ericjohnolson/NadaNtd
 public WizardForm(IWizardStep step, string t)
     : base()
 {
     currentStep = step;
     title = t;
     InitializeComponent();
 }
コード例 #2
0
 private void FireStepChanged(IWizardStep wizardStep)
 {
     if (StepChanged != null)
     {
         StepChanged(wizardStep);
     }
 }
コード例 #3
0
        /// <summary>
        /// Changes the current step.
        /// </summary>
        /// <param name="step">The new current step.</param>
        /// <param name="forward"><c>true</c> if we're stepping forward in the wizard.</param>
        public void StepTo(IWizardStep step, bool forward)
        {
            try
            {
                inStepTo = true;

                if (current != null && !current.OnStepOut(this, forward))
                {
                    return;
                }

                current = step;

                if (step != null)
                {
                    step.OnStepIn(this);
                }

                wizard.OnStep(this, step);
            }
            finally
            {
                inStepTo = false;

                if (skipToFinish)
                {
                    skipToFinish = false;
                    StepTo(LastStep, false);
                }
            }
        }
コード例 #4
0
ファイル: SplitDistro.cs プロジェクト: ericjohnolson/NadaNtd
 public SplitDistro(RedistrictingOptions o, IWizardStep p)
     : base()
 {
     prev = p;
     options = o;
     InitializeComponent();
 }
コード例 #5
0
 public StepAdminLevelImport(AdminLevelType type, IWizardStep p, DateTime d, bool isImport)
     : base()
 {
     isSingleImport = isImport;
     demoDate = d;
     Init(type, p, true, null);
 }
コード例 #6
0
 private void UpdateButtonEnabling(IWizardStep <IStepView> currentStep)
 {
     _view.SetPreviousEnabled(!IsFirstStep());
     _view.SetNextEnabled(!IsLastStep());
     _view.SetFinishEnabled(IsLastStep());
     _view.SetFastForwardEnabled(!IsLastStep() && currentStep.IsValid());
 }
コード例 #7
0
        public void GoToStep(IWizardStep step)
        {
            if (step is Controls.Welcome)
            {
                _history.Clear();
            }
            var ctrl = step as Control;

            if (ctrl == null)
            {
                throw new ArgumentException("Each step must be a control.");
            }

            var curr = tblMain.GetControlFromPosition(1, 3);

            if (curr != null)
            {
                tblMain.Controls.Remove(curr);
            }

            ctrl.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            tblMain.Controls.Add(ctrl, 1, 3);
            this.Message   = "";
            this.NextLabel = "&Next";
            step.Configure(this);

            btnPrevious.Enabled = _history.Any();
            _history.Push(step);
        }
コード例 #8
0
        public void TestHeaderLabelEnabledWhen_WizardStepTextSet()
        {
            //---------------Set up test pack-------------------
            IWizardControllerSpy wizardController = CreateWizardControllerStub();
            IWizardControl       wizardControl    = GetControlFactory().CreateWizardControl(wizardController);

            SetWizardControlSize(wizardControl);
            wizardControl.Start();
            //--------------Assert PreConditions----------------
            Assert.AreEqual("ControlForStep1", wizardControl.CurrentControl.Name);
            //Assert.IsFalse(wizardControl.HeadingLabel.Visible);
            //Assert.AreEqual(wizardControl.Height - wizardControl.NextButton.Height - 62, wizardControl.WizardStepPanel.Height);
            //---------------Execute Test ----------------------
            wizardControl.Next();
            //---------------Test Result -----------------------
            IWizardStep currentStep = wizardController.GetCurrentStep();

            Assert.AreEqual("ControlForStep2", wizardControl.CurrentControl.Name);
            Assert.AreSame(currentStep, wizardControl.CurrentControl);
            Assert.IsTrue(((IWizardStepStub)currentStep).IsInitialised);
            //Assert.IsTrue(wizardControl.HeadingLabel.Visible);
            //Assert.IsTrue(wizardControl.HeadingLabel.Text.Length > 0);
            //Assert.AreEqual(step.HeaderText, wizardControl.HeadingLabel.Text);
            //Assert.AreEqual(wizardControl.Height - wizardControl.NextButton.Height - 62 - wizardControl.HeadingLabel.Height, wizardControl.WizardStepPanel.Height);
        }
コード例 #9
0
        public void Test_FinishError()
        {
            WizardController wizardController = new WizardController();

            IWizardStep step1 = MockRepository.GenerateMock <IWizardStep>();

            step1.Stub(wizardStep => wizardStep.CanFinish()).Return(false);
            wizardController.AddStep(step1);
            wizardController.AddStep(step1);

            wizardController.GetFirstStep();
            //------------------------Assert Precondition----------------
            Assert.AreSame(step1, wizardController.GetCurrentStep());
            Assert.IsFalse(wizardController.IsLastStep());
            Assert.IsFalse(wizardController.CanFinish(), "Should not be able to finish this");
            //------------------------Execute----------------------------
            try
            {
                wizardController.Finish();
                Assert.Fail("Expected to throw an WizardStepException");
            }
            //---------------Test Result -----------------------
            catch (WizardStepException ex)
            {
                StringAssert.Contains("Invalid call to Finish(), not at last step", ex.Message);
            }
        }
コード例 #10
0
 public ImportStepResult(ImportResult r, IWizardStep p)
     : base()
 {
     result = r;
     prev = p;
     InitializeComponent();
 }
コード例 #11
0
 public StepLocations(SavedReport o, IWizardStep p)
     : base()
 {
     prev = p;
     report = o;
     InitializeComponent();
 }
コード例 #12
0
 protected void FireStepChanged(IWizardStep wizardStep)
 {
     if (StepChanged != null)
     {
         StepChanged(wizardStep);
     }
 }
コード例 #13
0
 private void HookEventHandlers(IWizardStep wizardStep)
 {
     wizardStep.Previous += OnWizardStepOnPrevious;
     wizardStep.Next     += OnWizardStepOnNext;
     wizardStep.Finish   += OnWizardStepOnFinish;
     wizardStep.Cancel   += (sender, e) => CancelWizard();
 }
コード例 #14
0
        /// <summary/>
        public void Bind(IWizardStep step, bool isFirst, bool isLast)
        {
            _stepName.Text             = step.StepName;
            _optionalIndicator.Visible = step.IsOptional;

            if (step.IsComplete)
            {
                _statusImage.Image = Properties.Resources.WizardStepComplete;
            }
            else
            {
                _statusImage.Image = Properties.Resources.WizardNotComplete;
            }

            _lineToNextImage.Image     = Properties.Resources.WizardConnectToStep;
            _lineToPreviousImage.Image = Properties.Resources.WizardConnectToStep;

            if (isFirst)
            {
                _lineToPreviousImage.Visible = false;
            }
            if (isLast)
            {
                _lineToNextImage.Visible = false;
            }

            if (step.IsCurrent)
            {
                _stepName.Font = new Font(_stepName.Font, FontStyle.Bold | FontStyle.Underline);
            }
            else
            {
                _stepName.Font = new Font(_stepName.Font, FontStyle.Regular);
            }
        }
コード例 #15
0
 public MergeDestination(RedistrictingOptions o, IWizardStep p)
     : base()
 {
     options = o;
     prev = p;
     InitializeComponent();
 }
コード例 #16
0
 public SplittingSaes(RedistrictingOptions o, IWizardStep p)
     : base()
 {
     InitializeComponent();
     options = o;
     prev = p;
 }
コード例 #17
0
ファイル: WizardModule.cs プロジェクト: via5/vam-embody
    public void StopWizard(string message = null)
    {
        if (!enabledJSON.val)
        {
            return;
        }

        context.diagnostics.Log("Wizard: Stop");

        StopCoroutine(_coroutine);
        _coroutine = null;

        if (_step != null)
        {
            try
            {
                _step.Leave(true);
            }
            catch (Exception exc)
            {
                SuperController.LogError($"Embody: Wizard {_step}.Leave failed: {exc}");
            }
            _step = null;
        }

        context.embody.activeJSON.val = false;
        context.trackers.previewTrackerOffsetJSON.val = false;
        context.snug.previewSnugOffsetJSON.val        = false;

        statusJSON.val = message ?? _wizardIntroMessage;
        _next          = false;
        _skip          = false;
        statusChanged.Invoke(false);
        enabledJSON.val = false;
        SuperController.singleton.worldScale = 1f;

        if (_poseJSON != null)
        {
            foreach (var storableJSON in _poseJSON.Childs)
            {
                var storableId = storableJSON["id"].Value;
                if (string.IsNullOrEmpty(storableId))
                {
                    continue;
                }
                var storable = containingAtom.GetStorableByID(storableId);
                storable.PreRestore();
                storable.RestoreFromJSON(storableJSON.AsObject);
                storable.PostRestore();
            }
            _poseJSON = null;
        }

        if (_navigationRigSnapshot != null)
        {
            _navigationRigSnapshot.Restore();
            _navigationRigSnapshot = null;
        }
    }
コード例 #18
0
ファイル: WizardPanel.cs プロジェクト: sakwa-im/design-studio
 private void  OnControlRemoved(object sender, ControlEventArgs e)
 {
     if (e.Control is IWizardStep)
     {
         IWizardStep ws = e.Control as IWizardStep;
         _WizardSteps.Remove(ws);
     }
 }
コード例 #19
0
 public IndStepResult(IndicatorUpdateResult r, IWizardStep p)
     : base()
 {
     result = r;
     prev = p;
     showFinish = result.WasSuccess;
     InitializeComponent();
 }
コード例 #20
0
 public ValidationStepResult(ImportResult r, IWizardStep p)
     : base()
 {
     result = r;
     prev = p;
     InitializeComponent();
     SetStepTitle(r);
 }
コード例 #21
0
 public ImportStepResult(ImportResult r, IWizardStep p, bool f)
     : base()
 {
     showFinish = f;
     result = r;
     prev = p;
     InitializeComponent();
 }
コード例 #22
0
 /// <summary>
 /// Constructs an empty list.
 /// </summary>
 /// <param name="wizard">The parent wizard form.</param>
 public WizardStepList(InstallWizard wizard)
 {
     this.wizard       = wizard;
     this.list         = new ArrayList();
     this.current      = null;
     this.skipToFinish = false;
     this.inStepTo     = false;
 }
コード例 #23
0
 /// <summary>
 /// Adds a <see cref="IWizardStep"/> to the steps maintained by <see cref="WizardModel"/>.
 /// </summary>
 /// <param name="step">The <see cref="IWizardStep"/> to add.</param>
 protected void AddStep(IWizardStep step)
 {
     steps.Add(step);
     if (steps.Count == 1)
     {
         CurrentStep = step;
     }
 }
コード例 #24
0
 public ValidationStepResult(ImportResult r, IWizardStep p, bool f)
     : base()
 {
     showFinish = f;
     result = r;
     prev = p;
     InitializeComponent();
     SetStepTitle(r);
 }
コード例 #25
0
 public void AddStep(IWizardStep step)
 {
     if (step != null)
     {
         step.CanNext += CanNext;
     }
     steps.Add(step);
     StepMax = steps.Count;
 }
コード例 #26
0
 public ImportStepSurveyNameToSentinel(ImportOptions o, IWizardStep prev, string file, Dictionary<string, SurveyUnitsAndSentinelSite> surveyNamesDict)
     : base()
 {
     options = o;
     previousStep = prev;
     filename = file;
     surveyNamesDictionary = surveyNamesDict;
     InitializeComponent();
 }
コード例 #27
0
 public UpdateDbResult(bool s, string r, IWizardStep p, Action restart)
     : base()
 {
     result = r;
     wasSuccessful = s;
     OnRestart = restart;
     prev = p;
     InitializeComponent();
 }
コード例 #28
0
 public MessageBoxStep(string title, string message, bool error, IWizardStep p)
     : base()
 {
     wasError = error;
     StepTitle = title;
     msg = message;
     prev = p;
     InitializeComponent();
 }
コード例 #29
0
 protected void RegisterStep(IWizardStep step)
 {
     step.StepIsValidChangedEvent += OnStepIsValidChangedEvent;
     _registeredStepList.Add(step);
     OnPropertyChanged("AllRegisteredSteps");
     OnPropertyChanged("TotalStepsCount");
     OnPropertyChanged("CurrentStep");
     OnPropertyChanged("CurrentStepNumber");
 }
コード例 #30
0
ファイル: StepDdReview.cs プロジェクト: ericjohnolson/NadaNtd
 public StepDdReview(DdUpdateViewModel v, IWizardStep p)
     : base()
 {
     vm = v;
     prev = p;
     SettingsRepository settings = new SettingsRepository();
     stepTitle = Translations.UpdateDiseaseDistro + " - " + vm.Diseases[vm.DiseaseStepNumber].DisplayName;
     InitializeComponent();
 }
コード例 #31
0
        public void TestGetPreviousStep()
        {
            IWizardStep step2 = _mock.StrictMock <IWizardStep>();

            _wizardController.AddStep(step2);
            _wizardController.GetNextStep();
            _wizardController.GetNextStep();
            Assert.AreSame(_step1, _wizardController.GetPreviousStep());
        }
コード例 #32
0
ファイル: AddBlogWizard.cs プロジェクト: Shine6Z/GenXSource
 private void ChangeStep(IWizardStep currentStep, Predicate <Int32> canChange, StepIndexChanger stepIndexChanger)
 {
     if (canChange(_currentStepIndex))
     {
         currentStep.Hide();
         _currentStepIndex = stepIndexChanger(_currentStepIndex);
         _steps[_currentStepIndex].Show(_wizardOwner, currentStep.BlogDescriptor);
     }
 }
コード例 #33
0
 private void ChangeStep(IWizardStep currentStep, Predicate<Int32> canChange, StepIndexChanger stepIndexChanger)
 {
     if (canChange(_currentStepIndex))
     {
         currentStep.Hide();
         _currentStepIndex = stepIndexChanger(_currentStepIndex);
         _steps[_currentStepIndex].Show(_wizardOwner, currentStep.BlogDescriptor);
     }
 }
コード例 #34
0
ファイル: StartupView.cs プロジェクト: ericjohnolson/NadaNtd
 private void LoadWiz(IWizardStep step)
 {
     WizardForm wiz = new WizardForm(step, Translations.StartUpTasks);
     wiz.OnFinish = () => { };
     wiz.OnClose = () =>
     {
         CheckStatus();
     };
     wiz.ShowDialog();
 }
コード例 #35
0
        private void WizardLastStep_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "IsComplete")
            {
                IWizardStep lastStep = (WizardStep)sender;
                NewViewState = (ViewState)((CreateViewWizard4)lastStep).GetViewState();

                DialogResult = DialogResult.OK;
            }
        }
コード例 #36
0
 private void WizardControl_StepChanged(IWizardStep obj)
 {
     try
     {
         this.Text = this.WizardText + " - " + obj.HeaderText;
     }
     catch (Exception ex)
     {
         GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error ");
     }
 }
コード例 #37
0
 /// <summary>
 /// Returns the Previous Step and sets the step pointer to that step.
 /// </summary>
 /// <exception cref="WizardStepException">Thrown if the current step is the first step.</exception>
 /// <returns>The previous step.</returns>
 public virtual IWizardStep GetPreviousStep()
 {
     if (CurrentStep > 0)
     {
         _visitedSteps.Pop();
         IWizardStep previousStep = _visitedSteps.Peek();
         CurrentStep = WizardSteps.IndexOf(previousStep);
         return(previousStep);
     }
     throw new WizardStepException("Invalid Wizard Step: " + (CurrentStep - 1));
 }
コード例 #38
0
        public void AddStep(IWizardStep step)
        {
            if (step == null)
                throw new ArgumentNullException("step");
            _steps.Add(step);

            step.Back += WizardStep_Back;
            step.Cancel += WizardStep_Cancel;
            step.Finish += WizardStep_Finish;
            step.Next += WizardStep_Next;
        }
コード例 #39
0
 public ImportStepSurveyNameUnits(ImportOptions o, IWizardStep prev, string file, Dictionary<string, SurveyUnitsAndSentinelSite> surveyNamesDict, int i)
     : base()
 {
     stepTitle = Translations.ChooseAdminLevels + " - " + surveyNamesDict.Keys.ElementAt(i);
     index = i;
     surveyNamesDictionary = surveyNamesDict;
     filename = file;
     previousStep = prev;
     options = o;
     InitializeComponent();
 }
コード例 #40
0
        public WizardStepContainerViewModel(WizardControlViewModel parent, int step, IWizardStep stepViewModel)
        {
            ParentWizard       = parent;
            Step               = step;
            this.stepViewModel = stepViewModel;

            parent.PropertyChanged += (o, e) => { if (e.PropertyName.Equals("CurrentStep"))
                                                  {
                                                      OnPropertyChanged("StepVisible");
                                                  }
            };
        }
        public DownloadWindow(Wizard wizard)
        {
            InitializeComponent();
            Commons.CenterWindow(this);

            _canceled = false;
            _wizard = wizard;
            _wizard.ProgressChanged += new Wizard.ProgressHandler(UpdateProgress);
            _nextStep = null;
            progressBar.Maximum = 1;
            progressBar.Minimum = 0;
        }
コード例 #42
0
ファイル: WizardPanel.cs プロジェクト: sakwa-im/design-studio
 private void OnStepSelected(object sender, EventArgs e)
 {
     if (sender is IWizardStep)
     {
         IWizardStep ws = sender as IWizardStep;
         if (CurrentStep != ws.StepNumber)
         {
             CurrentStep = ws.StepNumber;
             SignalStep();
         }
     }
 } //private void OnStepSelected(
コード例 #43
0
        protected virtual Label GetStepLabel(IWizardStep step)
        {
            Label label = new Label();

            label.Location  = new System.Drawing.Point(11, 8);
            label.Name      = "lblStepCaption" + step.Name;
            label.Size      = new Size(pnlStepCaptions.Width, (int)((pnlStepCaptions.Height * .75) / _wizardSteps.Count));
            label.Text      = $"{step.Index + 1}.  {step.Name}";
            label.TextAlign = ContentAlignment.MiddleLeft;
            label.ForeColor = Color.Silver;

            return(label);
        }
コード例 #44
0
        /// <summary>
        /// Returns the next step in the list (or <c>null</c>).
        /// </summary>
        /// <param name="step">The current step.</param>
        public IWizardStep GetNext(IWizardStep step)
        {
            var pos = list.IndexOf(step);

            if (pos == -1 || pos >= list.Count - 1)
            {
                return(null);
            }
            else
            {
                return((IWizardStep)list[pos + 1]);
            }
        }
コード例 #45
0
ファイル: AddBlogWizard.cs プロジェクト: Shine6Z/GenXSource
        public void AddStep(IWizardStep step)
        {
            if (step == null)
            {
                throw new ArgumentNullException("step");
            }
            _steps.Add(step);

            step.Back   += WizardStep_Back;
            step.Cancel += WizardStep_Cancel;
            step.Finish += WizardStep_Finish;
            step.Next   += WizardStep_Next;
        }
コード例 #46
0
        /// <summary>
        /// Returns the previous step in the list (or <c>null</c>).
        /// </summary>
        /// <param name="step">The current step.</param>
        public IWizardStep GetPrev(IWizardStep step)
        {
            var pos = list.IndexOf(step);

            if (pos <= 0)
            {
                return(null);
            }
            else
            {
                return((IWizardStep)list[pos - 1]);
            }
        }
コード例 #47
0
ファイル: WizardPanel.cs プロジェクト: sakwa-im/design-studio
        private IWizardStep GetNextWizardStep()
        {
            for (int i = _CurrentStep + 1; i <= _WizardSteps.Count; i++)
            {
                IWizardStep ws = _WizardSteps[i - 1];
                if (ws.StepNumber >= _CurrentStep && ws.Enabled)
                {
                    return(ws);
                }
            }

            return(null);
        }
コード例 #48
0
ファイル: WizardPanel.cs プロジェクト: sakwa-im/design-studio
        private IWizardStep GetPrevWizardStep()
        {
            for (int i = _CurrentStep - 1; i > 0; i--)
            {
                IWizardStep ws = _WizardSteps[i - 1];
                if (ws.Enabled)
                {
                    return(ws);
                }
            }

            return(null);
        }
コード例 #49
0
ファイル: WizardPanel.cs プロジェクト: sakwa-im/design-studio
        } //private IWizardStep GetWizardStep(int stepNumber)

        private void SignalStep()
        {
            foreach (IWizardBar wb in _ConnectedWizardBars)
            {
                wb.CurrentStep = _CurrentStep;
            }

            IWizardStep ws = GetWizardStep(_CurrentStep);

            if (ws != null && OnWizardStep != null)
            {
                OnWizardStep(this, new WizardEventArgs(ws.StepNumber, ws.Text));
            }
        }
コード例 #50
0
ファイル: WizardPanel.cs プロジェクト: sakwa-im/design-studio
        } //bool IWizardBar.MoveToFirstStep()

        bool IWizardBar.MoveToNextStep()
        {
            IWizardStep ws = GetNextWizardStep();

            if (ws != null)
            {
                CurrentStep = ws.StepNumber;

                SignalStep();

                return(true);
            }

            return(false);
        }
コード例 #51
0
ファイル: WizardForm.cs プロジェクト: ericjohnolson/NadaNtd
 private void LoadStep(IWizardStep step)
 {
     currentStep = step;
     step.OnSwitchStep = (s) => { LoadStep(s); };
     step.OnRunReport = RunReport;
     step.OnFinish = DoFinish;
     lblStepTitle.Text = step.StepTitle;
     btnPrev.Visible = step.ShowPrev;
     btnPrev.Enabled = step.EnablePrev;
     btnNext.Visible = step.ShowNext;
     btnNext.Enabled = step.EnableNext;
     btnFinish.Visible = step.ShowFinish;
     btnFinish.Enabled = step.EnableFinish;
     pnlContent.Controls.Clear();
     pnlContent.Controls.Add((Control)step);
 }
コード例 #52
0
 public DeployWizardController(WizardModel model, IDeployWizardView view, IProfileManager profileManager,
     IEnumerable<IWizardStep<IStepView>> steps, IWizardStep<IStepView> finishStep)
 {
     _model = model;
     _model.ProfileChanged += ChangeTitle;
     _profileManager = profileManager;
     _view = view;
     _steps = steps;
     _finishStep = finishStep;
     _view.PreviousClicked += Previous;
     _view.NextClicked += Next;
     _view.FastForwardClicked += FastForward;
     _view.SaveClicked += SaveProfile;
     _view.FinishClicked += Finish;
     _view.CloseClicked += Close;
     ShowCurrentStep();
 }
コード例 #53
0
 private void Init(AdminLevelType type, IWizardStep step, bool demoOnly, int? cid)
 {
     countryDemoId = cid;
     isDemoOnly = demoOnly;
     locationType = type;
     prev = step;
     SettingsRepository settings = new SettingsRepository();
     DemoRepository demo = new DemoRepository();
     if (!isDemoOnly)
         demoDate = demo.GetCountryDemoRecent().DateDemographyData;
     if (!isSingleImport)
     {
         nextType = settings.GetNextLevel(locationType.LevelNumber);
         stepTitle = isDemoOnly ? Translations.UpdateDemography + " - " + locationType.DisplayName : Translations.ImportAdminLevels + locationType.DisplayName;
         importer = new AdminLevelDemoImporter(locationType, countryDemoId);
     }
     else
         stepTitle = Translations.Demography + " - " + locationType.DisplayName;
     updater = new AdminLevelDemoUpdater(locationType, countryDemoId);
     InitializeComponent();
 }
コード例 #54
0
ファイル: Wizard.cs プロジェクト: richardadalton/WizardFX
 public Wizard AddStep(IWizardStep step)
 {
     step.ParentWizard = this;
     _steps.Add(step);
     return this;
 }
コード例 #55
0
 public StepDemoCountryDemo(IWizardStep p, DemoUpdateViewModel v)
 {
     vm = v;
     prev = p;
     InitializeComponent();
 }
コード例 #56
0
 protected void FireStepChanged(IWizardStep wizardStep)
 {
     if (StepChanged != null)
     {
         StepChanged(wizardStep);
     }
 }
コード例 #57
0
        private void SetStep(IWizardStep step)
        {
            if (step == null) throw new ArgumentNullException("step");
            IControlHabanero stepControl = step;

            CurrentControl = stepControl;
            FireStepChanged(step);
            _wizardStepPanel.Controls.Clear();
            stepControl.Top = WizardControl.PADDING;
            stepControl.Left = WizardControl.PADDING;
            stepControl.Width = _wizardStepPanel.Width - WizardControl.PADDING*2;
            stepControl.Height = _wizardStepPanel.Height - WizardControl.PADDING*2;
            _wizardStepPanel.Controls.Add(stepControl);

            step.InitialiseStep();
        }
コード例 #58
0
 /// <summary>
 /// Adds a <see cref="IWizardStep"/> to the steps maintained by <see cref="WizardModel"/>.
 /// </summary>
 /// <param name="step">The <see cref="IWizardStep"/> to add.</param>
 protected void AddStep(IWizardStep step)
 {
     steps.Add(step);
     if (steps.Count == 1)
     {
         CurrentStep = step;
     }
 }
コード例 #59
0
 private void UpdateButtonEnabling(IWizardStep<IStepView> currentStep)
 {
     _view.SetPreviousEnabled(!IsFirstStep());
     _view.SetNextEnabled(!IsLastStep());
     _view.SetFinishEnabled(IsLastStep());
     _view.SetFastForwardEnabled(!IsLastStep() && currentStep.IsValid());
 }
コード例 #60
0
 private bool IsLast(IWizardStep step)
 {
     return steps.Any() && steps.Last() == step;
 }