/// <summary> /// Initializes a new instance of the <see cref="AreaControllerRenderer"/> class. /// </summary> /// <param name="controllerInfo"> /// The controller info. /// </param> /// <param name="controllerRunner"> /// The controller runner /// </param> public AreaControllerRenderer( ControllerInfo controllerInfo, ControllerRunner controllerRunner) { this.controllerInfo = controllerInfo; this.controllerRunner = controllerRunner; }
/// <summary> /// Initializes a new instance of the <see cref="AreaControllerRunner"/> class. /// </summary> /// <param name="controllerInfo"> /// The controller Info. /// </param> /// <param name="controllerFactory"> /// The controller Factory. /// </param> public AreaControllerRunner(ControllerInfo controllerInfo) : base(controllerInfo.ControllerName, controllerInfo.ActionName) { Assert.ArgumentNotNull(controllerInfo, "controllerInfo"); this.Area = controllerInfo.AreaName; }
/// <summary> /// The get renderer. /// </summary> /// <param name="rendering"> /// The rendering. /// </param> /// <param name="args"> /// The args. /// </param> /// <returns> /// The <see cref="Renderer"/>. /// </returns> protected virtual Renderer GetRenderer(Rendering rendering, GetRendererArgs args) { var rendererFactory = this.GetControllerRendererFactory(); if (rendererFactory == null) { return null; } var controllerInfo = new ControllerInfo( rendering.RenderingItem.InnerItem["controller"], rendering.RenderingItem.InnerItem["controller action"], rendering.RenderingItem.InnerItem["area"]); return rendererFactory.CreateRenderer(controllerInfo); }
/// <summary> /// Use the Unity container to resolve a Renderer. Presumably, this would return an AreaControllerRenderer. /// </summary> /// <param name="controllerInfo"> /// The controller info. /// </param> /// <returns> /// The <see cref="Renderer"/>. /// </returns> public Renderer CreateRenderer(ControllerInfo controllerInfo) { return this.container.Resolve<Renderer>( RegistrationName, new ParameterOverride("controllerInfo", controllerInfo)); }
/// <summary> /// The create renderer. /// </summary> /// <param name="controllerInfo"> /// The controller info. /// </param> /// <returns> /// The <see cref="Renderer"/>. /// </returns> public virtual Renderer CreateRenderer(ControllerInfo controllerInfo) { return new AreaControllerRenderer(controllerInfo, new AreaControllerRunner(controllerInfo)); }