Class ComponentRendererDescriptor

Version: 21.x

Service descriptor for a IComponentRenderer.

Inheritance

System.Object

ComponentRendererDescriptor

Namespace: Sitecore.AspNet.RenderingEngine.Rendering

Assembly: Sitecore.AspNet.RenderingEngine.Abstractions.dll

Syntax
public class ComponentRendererDescriptor : Object

Constructors

ComponentRendererDescriptor(Predicate, Func<IServiceProvider, IComponentRenderer>)

Initializes a new instance of the ComponentRendererDescriptor class.

Declaration
public ComponentRendererDescriptor(Predicate<string> match, Func<IServiceProvider, IComponentRenderer> factory)
Parameters
TypeNameDescription
System.Predicate

<

System.String

>
matchThe predicate to use when retrieving a IComponentRenderer.
System.Func

<

System.IServiceProvider

,

IComponentRenderer

>
factoryThe factory method to create a new instance of the IComponentRenderer.

Properties

Match

Gets a predicate used for matching Sitecore layout components.

Declaration
public Predicate<string> Match { get; }
Property Value
TypeDescription
System.Predicate

<

System.String

>

Methods

GetOrCreate(IServiceProvider)

Gets an instance of an IComponentRenderer, creating one if it has not yet been instantiated.

Declaration
public IComponentRenderer GetOrCreate(IServiceProvider services)
Parameters
TypeNameDescription
System.IServiceProviderservicesThe System.IServiceProvider.
Returns
TypeDescription
IComponentRendererAn instance of an IComponentRenderer.
If you have suggestions for improving this article, let us know!