Class ComponentRendererFactory

Version: 21.x

Creates the appropriate instance of an IComponentRenderer for a given Component.

Inheritance

System.Object

ComponentRendererFactory

Implements

IComponentRendererFactory

Namespace: Sitecore.AspNet.RenderingEngine.Rendering

Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
public class ComponentRendererFactory : Object, IComponentRendererFactory

Constructors

ComponentRendererFactory(IOptions, IServiceProvider)

Initializes a new instance of the ComponentRendererFactory class.

Declaration
public ComponentRendererFactory(IOptions<RenderingEngineOptions> options, IServiceProvider services)
Parameters
TypeNameDescription
Microsoft.Extensions.Options.IOptions

<

RenderingEngineOptions

>
optionsThe RenderingEngineOptions for this instance.
System.IServiceProviderservicesThe services used for component renderer resolution.

Methods

GetRenderer(Component)

Retrieves an IComponentRenderer that has been configured to render the specified Component.

Declaration
public IComponentRenderer GetRenderer(Component component)
Parameters
TypeNameDescription
ComponentcomponentThe Component that requires rendering.
Returns
TypeDescription
IComponentRendererAn instance of an IComponentRenderer that has been configured to render the component.

Implements

IComponentRendererFactory

If you have suggestions for improving this article, let us know!