예제 #1
0
        protected void StartWizard(Controller controller, bool redirect)
        {
            ResetSteps(controller);

            IWizardController wizardController = controller as IWizardController;

            IRailsEngineContext context = controller.Context;

            IList stepList = (IList)context.UnderlyingContext.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.Name, firstStep);
            }
        }