/// <overloads>This method has three overloads.</overloads>
		/// <summary>
		/// Creates an anchor tag (link) to the specified step.
		/// <code>
		/// &lt;a href=&quot;/page2.rails&quot;&gt;linkText&lt;/a&gt;
		/// </code>
		/// </summary>
		/// <param name="linkText">The label for the step</param>
		/// <param name="step">The WizardStepPage to link to</param>
		/// <returns></returns>
		public string LinkToStep(string linkText, IWizardStepPage step)
		{
			return LinkToStep(linkText, step, null);
		}
		/// <summary>
		/// Creates an anchor tag (link) to the specified step.
		/// <code>
		/// &lt;a href=&quot;/page2.rails&quot;&gt;linkText&lt;/a&gt;
		/// </code>
		/// </summary>
		/// <param name="linkText">The label for the step</param>
		/// <param name="step">The WizardStepPage to link to</param>
		/// <param name="id">Object to use for the action ID argument.</param>
		/// <returns></returns>
		public string LinkToStep(string linkText, IWizardStepPage step, object id)
		{
			return LinkToStep(linkText, step, id, null);
		}
			public bool OnBeforeStep(string wizardName, string stepName, IWizardStepPage step)
			{
				throw new NotImplementedException();
			}
			public void OnAfterStep(string wizardName, string stepName, IWizardStepPage step)
			{
				throw new NotImplementedException();
			}
		public bool OnBeforeStep(String wizardName, String stepName, IWizardStepPage step)
		{
			return true;
		}
		public void OnAfterStep(String wizardName, String stepName, IWizardStepPage step)
		{
			
		}
Esempio n. 7
0
 public bool OnBeforeStep(String wizardName, String stepName, IWizardStepPage step)
 {
     return(true);
 }
Esempio n. 8
0
 public bool OnBeforeStep(string wizardName, string stepName, IWizardStepPage step)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 /// <summary>
 /// Creates an anchor tag (link) to the specified step.
 /// <code>
 /// &lt;a href=&quot;/page2.rails&quot;&gt;linkText&lt;/a&gt;
 /// </code>
 /// </summary>
 /// <param name="linkText">The label for the step</param>
 /// <param name="step">The WizardStepPage to link to</param>
 /// <param name="id">Object to use for the action ID argument.</param>
 /// <returns></returns>
 public string LinkToStep(string linkText, IWizardStepPage step, object id)
 {
     return(LinkToStep(linkText, step, id, null));
 }
Esempio n. 10
0
 /// <summary>
 /// Creates an anchor tag (link) to the specified step.
 /// <code>
 /// &lt;a href=&quot;/page2.rails&quot;&gt;linkText&lt;/a&gt;
 /// </code>
 /// </summary>
 /// <param name="linkText">The label for the step</param>
 /// <param name="step">The WizardStepPage to link to</param>
 /// <param name="id">Object to use for the action ID argument.</param>
 /// <param name="attributes">Additional attributes for the <b>a</b> tag.</param>
 /// <returns></returns>
 public string LinkToStep(string linkText, IWizardStepPage step, object id, IDictionary attributes)
 {
     return(LinkToStep(linkText, step.WizardControllerContext.AreaName, step.WizardControllerContext.Name, step.ActionName, id, attributes));
 }
Esempio n. 11
0
 /// <overloads>This method has three overloads.</overloads>
 /// <summary>
 /// Creates an anchor tag (link) to the specified step.
 /// <code>
 /// &lt;a href=&quot;/page2.rails&quot;&gt;linkText&lt;/a&gt;
 /// </code>
 /// </summary>
 /// <param name="linkText">The label for the step</param>
 /// <param name="step">The WizardStepPage to link to</param>
 /// <returns></returns>
 public string LinkToStep(string linkText, IWizardStepPage step)
 {
     return(LinkToStep(linkText, step, null));
 }
Esempio n. 12
0
		/// <summary>
		/// Creates an anchor tag (link) to the specified step.
		/// <code>
		/// &lt;a href=&quot;/page2.rails&quot;&gt;linkText&lt;/a&gt;
		/// </code>
		/// </summary>
		/// <param name="linkText">The label for the step</param>
		/// <param name="step">The WizardStepPage to link to</param>
		/// <param name="id">Object to use for the action ID argument.</param>
		/// <returns></returns>
		public String LinkToStep(String linkText, IWizardStepPage step, object id)
		{
			return LinkTo(linkText, step.WizardControllerContext.Name, step.ActionName, id);
		}
Esempio n. 13
0
 public void OnAfterStep(string wizardName, string stepName, IWizardStepPage step)
 {
     throw new NotImplementedException();
 }
		/// <summary>
		/// Creates an anchor tag (link) to the specified step.
		/// <code>
		/// &lt;a href=&quot;/page2.rails&quot;&gt;linkText&lt;/a&gt;
		/// </code>
		/// </summary>
		/// <param name="linkText">The label for the step</param>
		/// <param name="step">The WizardStepPage to link to</param>
		/// <param name="id">Object to use for the action ID argument.</param>
		/// <param name="attributes">Additional attributes for the <b>a</b> tag.</param>
		/// <returns></returns>
		public string LinkToStep(string linkText, IWizardStepPage step, object id, IDictionary attributes)
		{
			return LinkToStep(linkText, step.WizardControllerContext.AreaName, step.WizardControllerContext.Name, step.ActionName, id, attributes);
		}
Esempio n. 15
0
 public void OnAfterStep(String wizardName, String stepName, IWizardStepPage step)
 {
 }
Esempio n. 16
0
		/// <summary>
		/// Implementation of IDynamicActionProvider.
		/// <para>
		/// Grab all steps related to the wizard
		/// and register them as dynamic actions.
		/// </para>
		/// </summary>
		/// <param name="engineContext">The engine context.</param>
		/// <param name="controller">Wizard controller (must implement <see cref="IWizardController"/></param>
		/// <param name="controllerContext">The controller context.</param>
		public void IncludeActions(IEngineContext engineContext, IController controller, IControllerContext controllerContext)
		{
			// Primordial assert

			var wizardController = controller as IWizardController;

			if (wizardController == null)
			{
				throw new MonoRailException("The controller {0} must implement the interface " +
				                            "IWizardController to be used as a wizard", controllerContext.Name);
			}

			// Grab all Wizard Steps

			steps = wizardController.GetSteps(engineContext);

			if (steps == null || steps.Length == 0)
			{
				throw new MonoRailException("The controller {0} returned no WizardStepPage", controllerContext.Name);
			}

			var stepList = new List<string>();

			// Include the "start" dynamic action, which resets the wizard state

			controllerContext.DynamicActions["start"] = this;

			// Find out the action request (and possible inner action)
			//   Each action will be a step name, or maybe the step name + action (ie Page1-Save)

			urlInfo = engineContext.UrlInfo;

			rawAction = urlInfo.Action;

			requestedAction = ObtainRequestedAction(rawAction, out innerAction);

			// If no inner action was found, fallback to 'RenderWizardView'

			if (string.IsNullOrEmpty(innerAction))
			{
				innerAction = "RenderWizardView";
			}

			engineContext.Items["wizard.step.list"] = stepList;

			SetUpWizardHelper(engineContext, wizardController, controller, controllerContext);

			// Initialize all steps and while we are at it, 
			// discover the current step

			foreach(var step in steps)
			{
				var actionName = step.ActionName;

				step.WizardController = wizardController;
				step.WizardControllerContext = controllerContext;

				if (string.Compare(requestedAction, actionName, true) == 0)
				{
					currentStepInstance = step;

					if (innerAction != null)
					{
						// If there's an inner action, we invoke it as a step too
						controllerContext.DynamicActions[rawAction] = new DelegateDynamicAction(OnStepActionRequested);
					}

					engineContext.CurrentController = step;
				}
				else
				{
					controllerContext.DynamicActions[actionName] = new DelegateDynamicAction(OnStepActionRequested);
				}

				stepList.Add(actionName);
			}

			SetUpWizardHelper(engineContext, wizardController, controller, controllerContext);
		}
        /// <summary>
        /// Implementation of IDynamicActionProvider.
        /// <para>
        /// Grab all steps related to the wizard
        /// and register them as dynamic actions.
        /// </para>
        /// </summary>
        /// <param name="engineContext">The engine context.</param>
        /// <param name="controller">Wizard controller (must implement <see cref="IWizardController"/></param>
        /// <param name="controllerContext">The controller context.</param>
        public void IncludeActions(IEngineContext engineContext, IController controller, IControllerContext controllerContext)
        {
            // Primordial assert

            var wizardController = controller as IWizardController;

            if (wizardController == null)
            {
                throw new MonoRailException("The controller {0} must implement the interface " +
                                            "IWizardController to be used as a wizard", controllerContext.Name);
            }

            // Grab all Wizard Steps

            steps = wizardController.GetSteps(engineContext);

            if (steps == null || steps.Length == 0)
            {
                throw new MonoRailException("The controller {0} returned no WizardStepPage", controllerContext.Name);
            }

            var stepList = new List <string>();

            // Include the "start" dynamic action, which resets the wizard state

            controllerContext.DynamicActions["start"] = this;

            // Find out the action request (and possible inner action)
            //   Each action will be a step name, or maybe the step name + action (ie Page1-Save)

            urlInfo = engineContext.UrlInfo;

            rawAction = urlInfo.Action;

            requestedAction = ObtainRequestedAction(rawAction, out innerAction);

            // If no inner action was found, fallback to 'RenderWizardView'

            if (string.IsNullOrEmpty(innerAction))
            {
                innerAction = "RenderWizardView";
            }

            engineContext.Items["wizard.step.list"] = stepList;

            SetUpWizardHelper(engineContext, wizardController, controller, controllerContext);

            // Initialize all steps and while we are at it,
            // discover the current step

            foreach (var step in steps)
            {
                var actionName = step.ActionName;

                step.WizardController        = wizardController;
                step.WizardControllerContext = controllerContext;

                if (string.Compare(requestedAction, actionName, true) == 0)
                {
                    currentStepInstance = step;

                    if (innerAction != null)
                    {
                        // If there's an inner action, we invoke it as a step too
                        controllerContext.DynamicActions[rawAction] = new DelegateDynamicAction(OnStepActionRequested);
                    }

                    engineContext.CurrentController = step;
                }
                else
                {
                    controllerContext.DynamicActions[actionName] = new DelegateDynamicAction(OnStepActionRequested);
                }

                stepList.Add(actionName);
            }

            SetUpWizardHelper(engineContext, wizardController, controller, controllerContext);
        }