Search Results for

    Show / Hide Table of Contents
    View Source

    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
    object
    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 Source

    BlockEditorValues(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 Source

    ConvertAndClean(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 null if conversion fails.

    View Source

    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 null.

    Returns
    Type Description
    BlockEditorData<TValue, TLayout>

    The cleaned BlockEditorData<TValue, TLayout> instance, or null if the input is null or whitespace.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX