Castle.MonoRail.Framework.WizardActionProvider.StartWizard C# (CSharp) Method

StartWizard() protected method

Starts the wizard by adding the required information to the session and invoking IWizardController.OnWizardStart and detecting the first step.
protected StartWizard ( Controller controller, bool redirect ) : void
controller Controller The controller.
redirect bool if set to true, a redirect /// will be issued to the first step.
return void
		protected void StartWizard(Controller controller, bool redirect)
		{
			ResetSteps(controller);

			IWizardController wizardController = controller as IWizardController;

			IRailsEngineContext context = controller.Context;

			IList stepList = (IList) context.Items["wizard.step.list"];

			String firstStep = (String) stepList[0];

			String wizardName = WizardUtils.ConstructWizardNamespace(controller);

			context.Session[wizardName + "currentstepindex"] = 0;
			context.Session[wizardName + "currentstep"] = firstStep;

			wizardController.OnWizardStart();

			if (redirect)
			{
				context.Response.Redirect(controller.AreaName, controller.Name, firstStep);
			}
		}