Class BlockEditorValues<TValue, TLayout>
Used to deserialize json values and clean up any values based on the existence of element types and layout structure.
Inheritance
Namespace: Umbraco.Cms.Core.PropertyEditors
Assembly: Umbraco.Infrastructure.dll
Syntax
public class BlockEditorValues<TValue, TLayout> where TValue : BlockValue<TLayout>, new() where TLayout : class, IBlockLayoutItem, new()
Type Parameters
| Name | Description |
|---|---|
| TValue | |
| TLayout |
Constructors
View SourceBlockEditorValues(BlockEditorDataConverter<TValue, TLayout>, IBlockEditorElementTypeCache, ILogger)
Initializes a new instance of the BlockEditorValues<TValue, TLayout> class.
Declaration
public BlockEditorValues(BlockEditorDataConverter<TValue, TLayout> dataConverter, IBlockEditorElementTypeCache elementTypeCache, ILogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| BlockEditorDataConverter<TValue, TLayout> | dataConverter | The BlockEditorDataConverter<TValue, TLayout> used to convert block editor data. |
| IBlockEditorElementTypeCache | elementTypeCache | The IBlockEditorElementTypeCache used to cache block editor element types. |
| ILogger | logger | The Microsoft.Extensions.Logging.ILogger instance used for logging operations within the block editor values. |
Methods
View SourceConvertAndClean(TValue)
Converts the specified blockValue to a BlockEditorData<TValue, TLayout>, then cleans and returns the result.
Declaration
public BlockEditorData<TValue, TLayout>? ConvertAndClean(TValue blockValue)
Parameters
| Type | Name | Description |
|---|---|---|
| TValue | blockValue | The value to convert and clean. |
Returns
| Type | Description |
|---|---|
| BlockEditorData<TValue, TLayout> | The cleaned BlockEditorData<TValue, TLayout>, or |
DeserializeAndClean(object?)
Deserializes the specified property value into a BlockEditorData<TValue, TLayout> instance and cleans the resulting data.
Declaration
public BlockEditorData<TValue, TLayout>? DeserializeAndClean(object? propertyValue)
Parameters
| Type | Name | Description |
|---|---|---|
| object | propertyValue | The property value to deserialize and clean. If null or whitespace, the method returns |
Returns
| Type | Description |
|---|---|
| BlockEditorData<TValue, TLayout> | The cleaned BlockEditorData<TValue, TLayout> instance, or |