Search Results for

    Show / Hide Table of Contents
    View Source

    Class BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>

    Inheritance
    System.Object
    PropertyValueConverterBase
    Namespace: Umbraco.Cms.Core.PropertyEditors.ValueConverters
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public abstract class BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration> : PropertyValueConverterBase, IPropertyValueConverter, IDiscoverable where TBlockItemModel : class, IBlockReference<IPublishedElement, IPublishedElement> where TBlockLayoutItem : IBlockLayoutItem where TBlockConfiguration : IBlockConfiguration
    Type Parameters
    Name Description
    TBlockModel
    TBlockItemModel
    TBlockLayoutItem
    TBlockConfiguration

    Constructors

    View Source

    BlockPropertyValueConverterBase(BlockEditorConverter)

    Declaration
    protected BlockPropertyValueConverterBase(BlockEditorConverter blockBlockEditorConverter)
    Parameters
    Type Name Description
    BlockEditorConverter blockBlockEditorConverter

    Properties

    View Source

    BlockEditorConverter

    Declaration
    protected BlockEditorConverter BlockEditorConverter { get; }
    Property Value
    Type Description
    BlockEditorConverter

    Methods

    View Source

    ConvertSourceToIntermediate(IPublishedElement, IPublishedPropertyType, Object, Boolean)

    Converts a property source value to an intermediate value.

    Declaration
    public override object ConvertSourceToIntermediate(IPublishedElement owner, IPublishedPropertyType propertyType, object source, bool preview)
    Parameters
    Type Name Description
    IPublishedElement owner

    The property set owning the property.

    IPublishedPropertyType propertyType

    The property type.

    System.Object source

    The source value.

    System.Boolean preview

    A value indicating whether conversion should take place in preview mode.

    Returns
    Type Description
    System.Object

    The result of the conversion.

    Remarks

    The converter should know how to convert a null source value, meaning that no value has been assigned to the property. The intermediate value can be null.

    With the XML cache, source values come from the XML cache and therefore are strings.

    With objects caches, source values would come from the database and therefore be either ints, DateTimes, decimals, or strings.

    The converter should be prepared to handle both situations.

    When source values are strings, the converter must handle empty strings, whitespace strings, and xml-whitespace strings appropriately, ie it should know whether to preserve white spaces.

    View Source

    CreateBlockEditorDataConverter()

    Creates a specific data converter for the block property implementation.

    Declaration
    protected abstract BlockEditorDataConverter CreateBlockEditorDataConverter()
    Returns
    Type Description
    BlockEditorDataConverter
    View Source

    CreateBlockItemActivator()

    Creates a specific block item activator for the block property implementation.

    Declaration
    protected abstract BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.BlockItemActivator<TBlockItemModel> CreateBlockItemActivator()
    Returns
    Type Description
    BlockPropertyValueConverterBase.BlockItemActivator<TBlockItemModel>
    View Source

    GetPropertyCacheLevel(IPublishedPropertyType)

    Gets the property cache level.

    Declaration
    public override PropertyCacheLevel GetPropertyCacheLevel(IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    PropertyCacheLevel

    The property cache level.

    View Source

    GetPropertyValueType(IPublishedPropertyType)

    Gets the type of values returned by the converter.

    Declaration
    public override Type GetPropertyValueType(IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    Type

    The CLR type of values returned by the converter.

    Remarks

    Some of the CLR types may be generated, therefore this method cannot directly return a Type object (which may not exist yet). In which case it needs to return a ModelType instance.

    View Source

    UnwrapBlockModel(PropertyCacheLevel, Object, Boolean, IEnumerable<TBlockConfiguration>, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.CreateEmptyBlockModel, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.CreateBlockModel, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.EnrichBlockItemModelFromConfiguration)

    Declaration
    protected TBlockModel UnwrapBlockModel(PropertyCacheLevel referenceCacheLevel, object inter, bool preview, IEnumerable<TBlockConfiguration> blockConfigurations, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.CreateEmptyBlockModel createEmptyModel, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.CreateBlockModel createModel, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.EnrichBlockItemModelFromConfiguration enrichBlockItem = null)
    Parameters
    Type Name Description
    PropertyCacheLevel referenceCacheLevel
    System.Object inter
    System.Boolean preview
    IEnumerable<TBlockConfiguration> blockConfigurations
    BlockPropertyValueConverterBase.CreateEmptyBlockModel<> createEmptyModel
    BlockPropertyValueConverterBase.CreateBlockModel<> createModel
    BlockPropertyValueConverterBase.EnrichBlockItemModelFromConfiguration<> enrichBlockItem
    Returns
    Type Description
    TBlockModel
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • BlockPropertyValueConverterBase(BlockEditorConverter)
    • Properties
      • BlockEditorConverter
    • Methods
      • ConvertSourceToIntermediate(IPublishedElement, IPublishedPropertyType, Object, Boolean)
      • CreateBlockEditorDataConverter()
      • CreateBlockItemActivator()
      • GetPropertyCacheLevel(IPublishedPropertyType)
      • GetPropertyValueType(IPublishedPropertyType)
      • UnwrapBlockModel(PropertyCacheLevel, Object, Boolean, IEnumerable<TBlockConfiguration>, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.CreateEmptyBlockModel, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.CreateBlockModel, BlockPropertyValueConverterBase<TBlockModel, TBlockItemModel, TBlockLayoutItem, TBlockConfiguration>.EnrichBlockItemModelFromConfiguration)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX