Search Results for

    Show / Hide Table of Contents
    View Source

    Class LabelValueConverter

    We need this property converter so that we always force the value of a label to be a string

    Inheritance
    System.Object
    PropertyValueConverterBase
    Namespace: Umbraco.Cms.Core.PropertyEditors.ValueConverters
    Assembly: Umbraco.Core.dll
    Syntax
    public class LabelValueConverter : PropertyValueConverterBase, IPropertyValueConverter, IDiscoverable
    Remarks

    Without a property converter defined for the label type, the value will be converted with the ConvertUsingDarkMagic method which will try to parse the value into it's correct type, but this can cause issues if the string is detected as a number and then strips leading zeros. Example: http://issues.umbraco.org/issue/U4-7929

    Methods

    View Source

    ConvertSourceToIntermediate(IPublishedElement, IPublishedPropertyType, Object, Boolean)

    Declaration
    public override object ConvertSourceToIntermediate(IPublishedElement owner, IPublishedPropertyType propertyType, object source, bool preview)
    Parameters
    Type Name Description
    IPublishedElement owner
    IPublishedPropertyType propertyType
    System.Object source
    System.Boolean preview
    Returns
    Type Description
    System.Object
    View Source

    GetPropertyCacheLevel(IPublishedPropertyType)

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

    GetPropertyValueType(IPublishedPropertyType)

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

    IsConverter(IPublishedPropertyType)

    Declaration
    public override bool IsConverter(IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • ConvertSourceToIntermediate(IPublishedElement, IPublishedPropertyType, Object, Boolean)
      • GetPropertyCacheLevel(IPublishedPropertyType)
      • GetPropertyValueType(IPublishedPropertyType)
      • IsConverter(IPublishedPropertyType)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX