Class RenderTemplateScanner
Default implementation of IRenderTemplateScanner. This implementation locates all classes that implements IRenderTemplate<TModel> and registers them.
Inheritance
System.Object
RenderTemplateScanner
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.Cms.AspNet.dll
Version: 11.20.7Syntax
[ServiceConfiguration(typeof(IRenderTemplateScanner))]
public class RenderTemplateScanner : IRenderTemplateScanner
Constructors
RenderTemplateScanner(ITemplatePathResolver, ITypeScannerLookup, ITemplateRepository, IModuleResourceResolver)
Initializes a new instance of the RenderTemplateScanner class.
Declaration
public RenderTemplateScanner(ITemplatePathResolver templatePathResolver, ITypeScannerLookup typeScannerLookup, ITemplateRepository templateModelRepository, IModuleResourceResolver resourcePathResolver)
Parameters
Type | Name | Description |
---|---|---|
ITemplatePathResolver | templatePathResolver | The template path resolver. |
ITypeScannerLookup | typeScannerLookup | The scanned type repository. |
ITemplateRepository | templateModelRepository | The render template repository. |
IModuleResourceResolver | resourcePathResolver | The resource path resolver. |
Methods
GetRenderTypes()
Get a list of all types matching the basic rendering template requirements.
Declaration
protected virtual IEnumerable<Type> GetRenderTypes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Type> | A list of non-abstract types that implements IRenderTemplate and that not has any unspecified generic type parameters. |
RegisterScannedRenders()
Registers any render templates found by type scanner in the ITemplateRepository.
Declaration
public virtual void RegisterScannedRenders()
RegisterTemplate(Type, TemplateModel[])
Called to register a model and the templates
Declaration
protected virtual void RegisterTemplate(Type modelType, params TemplateModel[] templates)
Parameters
Type | Name | Description |
---|---|---|
System.Type | modelType | The model type |
TemplateModel[] | templates | A list of templates |