Interface IDynamicContentFactory
Interface for dynamic content registration and creation.
Namespace: EPiServer.DynamicContent
Assembly: EPiServer.dll
Version: 10.10.4Syntax
public interface IDynamicContentFactory
Properties
DynamicContentId
Gets a unique identifier for the dynamic content generated by the factory.
Declaration
Guid DynamicContentId { get; }
Property Value
Type | Description |
---|---|
System.Guid | The unique identifier for the dynamic content generated by the factory. |
HashHandler
Gets the hash handler used to generate and validate hashes.
Declaration
IHashHandler HashHandler { get; }
Property Value
Type | Description |
---|---|
IHashHandler | The hash handler. |
Methods
ClearRegistrations()
Clears the registrations in the factory instance.
Declaration
void ClearRegistrations()
CreateDynamicContent(String, String, String, Boolean)
Creates a dynamic content control.
Declaration
IDynamicContentBase CreateDynamicContent(string name, string state, string hash, bool validateHash)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.String | state | |
System.String | hash | |
System.Boolean | validateHash |
Returns
Type | Description |
---|---|
IDynamicContentBase | The created control. |
Description(Type)
Returns the descriptions for the specified dynamic content type.
Declaration
string Description(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type. |
Returns
Type | Description |
---|---|
System.String | A description string. |
Remarks
This string will be used as a fallback for description if no description for the dynamic content type can be found in the language files.
GetMarkup(IDynamicContentBase, Boolean, ISecuredFragmentMarkupGenerator)
Gets the XHTML markup for the supplied dynamic content control.
Declaration
string GetMarkup(IDynamicContentBase dynamicContent, bool generateHash, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator)
Parameters
Type | Name | Description |
---|---|---|
IDynamicContentBase | dynamicContent | The dynamic content control. |
System.Boolean | generateHash | if set to |
ISecuredFragmentMarkupGenerator | securedFragmentMarkupGenerator | The group resolver. |
Returns
Type | Description |
---|---|
System.String | A string with HTML that represents the dynamic content. |
GetMarkupForEditor(IDynamicContentBase, Boolean, ISecuredFragmentMarkupGenerator)
Gets the markup that is presented when editing.
Declaration
string GetMarkupForEditor(IDynamicContentBase dynamicContent, bool generateHash, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator)
Parameters
Type | Name | Description |
---|---|---|
IDynamicContentBase | dynamicContent | The IDynamicContentBase to generate markup for. |
System.Boolean | generateHash | if set to |
ISecuredFragmentMarkupGenerator | securedFragmentMarkupGenerator | The group resolver. |
Returns
Type | Description |
---|---|
System.String | Markup that is loaded when loading the dynamic content in edit mode. |
InstantiateDynamicContent(String)
Instantiate a dynamic content control.
Declaration
IDynamicContentBase InstantiateDynamicContent(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
IDynamicContentBase | The created control. |
Name(Type)
Get the name of the specified dynamic content type.
Declaration
string Name(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type. |
Returns
Type | Description |
---|---|
System.String | The name as a string. |
Remarks
This string will be used as a fallback for display name if no display name for the dynamic content type can be found in the language files.
Register(Type, String, String)
Registers the specified dynamic content type.
Declaration
bool Register(Type type, string name, string description)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The dynamic content type. |
System.String | name | The name of the dynamic content. |
System.String | description | The description. |
Returns
Type | Description |
---|---|
System.Boolean | True if the registration succeeded, otherwise false. |
Remarks
The registration will fail if there is already a dynamic content registered with the same name or type.
RegisteredTypes()
Enumerates the registered dynamic contents types.
Declaration
IEnumerable<Type> RegisteredTypes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Type> | An System.Collections.Generic.IEnumerable<T> of System.Type for all the dynamic content types that have been registered. |