private bool AllowMoveToStep(T fromStep, T toStep) { WizardStepCollection steps = this.WizardSteps; int fromStepIndex; if (fromStep != null) { fromStepIndex = steps.IndexOf(fromStep); } else { fromStepIndex = 0; } int toStepIndex = steps.IndexOf(toStep); if (this.IsForwardNavigation(fromStep, toStep)) { for (int i = fromStepIndex; i < toStepIndex; i++) { if (!steps[i].IsCompleted) { return(false); } } return(true); } else { return(true); } }
protected BaseWizard(WizardStepCollection steps, IWizardNavigator <T> navigator) { if (steps == null) { this._steps = new WizardStepCollection(); } else { this._steps = steps; } this._navigator = navigator ?? throw new ArgumentNullException("navigator"); }
private bool TryGetPreviousStep(T fromStep, out T previousStep) { WizardStepCollection steps = this.WizardSteps; int index = steps.IndexOf(fromStep); if (index == 0) { previousStep = null; return(false); } else { previousStep = (T)steps[--index]; return(true); } }
public WizardNavigator(WizardStepCollection wizardSteps, IWizardNavigatorService <T> persistenceService) { this.wizardSteps = wizardSteps ?? throw new ArgumentNullException("wizardSteps"); this.persistenceService = persistenceService ?? throw new ArgumentNullException("persistenceService"); }
public WizardState(WizardStepCollection wizardSteps, string activeStepId) { this.WizardSteps = wizardSteps ?? throw new ArgumentNullException("wizardSteps"); this.ActiveStepId = activeStepId; }