Try our conversational search powered by Generative AI!

Class ViewRegistrator

Scan views for partial block views.

Inheritance
System.Object
ViewRegistrator
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction.RuntimeModel
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[ServiceConfiguration(typeof(IViewRegistrator))]
public class ViewRegistrator : IViewRegistrator

Constructors

ViewRegistrator(ITypeScannerLookup, IContentTypeModelScanner[], TemplateModelRepository, CachingViewEnginesWrapper)

Initializes a new instance of the ViewRegistrator class.

Declaration
public ViewRegistrator(ITypeScannerLookup typeScannerLookup, IContentTypeModelScanner[] contentTypeModelScanner, TemplateModelRepository templateModelRepository, CachingViewEnginesWrapper viewEngineWrapper)
Parameters
Type Name Description
ITypeScannerLookup typeScannerLookup

The type scanner lookup.

IContentTypeModelScanner[] contentTypeModelScanner

The content type model scanner.

TemplateModelRepository templateModelRepository

The render template repository.

CachingViewEnginesWrapper viewEngineWrapper

The view engine wrapper.

Properties

ViewEngines

Gets or sets the System.Web.Mvc.ViewEngineCollection to be used

Declaration
[Obsolete("Pass in dependency as constructor argument CachingViewEngineWrapper instead")]
public ViewEngineCollection ViewEngines { get; set; }
Property Value
Type Description
System.Web.Mvc.ViewEngineCollection
Remarks

This is exposed mainly for unit test purposes, at runtime it returns System.Web.Mvc.ViewEngines.Engines

Methods

FindPartialViewAndExecute(ControllerContext, String, Type, Action<ViewEngineResult>)

Called to find a partial view from ViewEngine and if view is found action delegate is called to perform action (typically register template) for view.

Declaration
[Obsolete("Method will removed in a future release.")]
protected virtual void FindPartialViewAndExecute(ControllerContext controllerContext, string partialViewName, Type contentType, Action<ViewEngineResult> action)
Parameters
Type Name Description
System.Web.Mvc.ControllerContext controllerContext

The controller context.

System.String partialViewName

Partial name of the view.

System.Type contentType

Type of the content.

System.Action<System.Web.Mvc.ViewEngineResult> action

The action.

RegisterTemplate(Type, TemplateModel)

Called when a template given by TemplateModel is registered for a System.Type.

Declaration
protected virtual void RegisterTemplate(Type modelType, TemplateModel templateModel)
Parameters
Type Name Description
System.Type modelType

Type of the model.

TemplateModel templateModel

The template model.

Exceptions
Type Condition
System.NotSupportedException

RegisterViews(HttpContextBase)

Registers the scanned views in the TemplateModelRepository.

Declaration
public virtual void RegisterViews(HttpContextBase contextBase)
Parameters
Type Name Description
System.Web.HttpContextBase contextBase

The context base.

Implements

Extension Methods