private void OnStepActionRequested(Controller controller)
{
if (currentStepInstance != null && !HasRequiredSessionData(controller))
{
StartWizard(controller, false);
}
controller.CancelView();
IRailsEngineContext context = controller.Context;
IWizardController wizController = (IWizardController) controller;
String wizardName = WizardUtils.ConstructWizardNamespace(controller);
String currentStep = (String) context.Session[wizardName + "currentstep"];
// The step will inherit the controller property bag,
// this way filters can pass values to the step property without having to know it
currentStepInstance.PropertyBag = controller.PropertyBag;
// If OnBeforeStep returns false we stop
if (!wizController.OnBeforeStep(wizardName, currentStep, currentStepInstance))
{
return;
}
// Initialize step data so instance members can be used
// executor.InitializeController(urlInfo.Area, urlInfo.Controller, innerAction);
// Record the step we're working with
WizardUtils.RegisterCurrentStepInfo(controller, currentStepInstance.ActionName);
// The step cannot be accessed in the current state of matters
if (!currentStepInstance.IsPreConditionSatisfied(controller.Context))
{
return;
}
// Dispatch process
try
{
// TODO: Invoke Whole step here
// currentStepInstance.Process(controller.Context,
// urlInfo.Area, urlInfo.Controller, innerAction);
currentStepExecutor.ProcessSelectedAction();
}
finally
{
wizController.OnAfterStep(wizardName, currentStep, currentStepInstance);
currentStepExecutor.Dispose();
}
}