public LinearWizardBuilder(string wizardName, IConfiguration configuration, IWizardNavigatorService <WizardStep> persistenceService) { Utility.ThrowIfNull(wizardName, nameof(wizardName)); Utility.ThrowIfNull(configuration, nameof(configuration)); this.navigatorPersistenceService = persistenceService ?? throw new ArgumentNullException("persistenceService"); steps = new WizardStepCollection(); var wizardSection = configuration.GetSection($"Wizards:{wizardName}"); foreach (IConfigurationSection section in wizardSection.GetChildren()) { AddStep(section.GetValue <string>("id"), section.GetValue <string>("title"), section.GetValue <string>("controllername"), section.GetValue <string>("action")); } }
public void Init() { //Create steps this.steps = new WizardStepCollection(); this.steps.Add(new WizardStep("1", "Login Info", false)); this.steps.Add(new WizardStep("2", "User Info", false)); this.steps.Add(new WizardStep("3", "Profile Info", false)); this.steps.Add(new WizardStep("4", "Account Info", false)); this.steps.Add(new WizardStep("5", "Summary", false)); Assert.IsTrue(this.steps.Count == 5); //Create navigatro this.navigator = new WizardNavigator <WizardStep>(this.steps, null); Assert.IsTrue(this.navigator != null); Assert.IsTrue(!this.navigator.Started); //Create Wizard //this.wizard = new Wizard<Step>(this.steps, this.navigator); Assert.IsTrue(this.wizard != null); //Test wizard indexer (access step by it's id) Assert.IsTrue(this.wizard["1"].Id == this.steps[0].Id); }
public LinearWizard(WizardStepCollection steps, IWizardNavigator <WizardStep> navigator) : base(steps, navigator) { }
public WizardContext(IWizardSettings settings) { stepsCollection = new WizardStepCollection(); stepsCollection.AddRange(settings); }