Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublishedPropertyType

    Represents a published property type.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Models.PublishedContent
    Assembly: Umbraco.Core.dll
    Syntax
    public class PublishedPropertyType : IPublishedPropertyType
    Remarks

    Instances of the PublishedPropertyType class are immutable, ie if the property type changes, then a new class needs to be created.

    Constructors

    View Source

    PublishedPropertyType(String, Int32, Boolean, ContentVariation, PropertyValueConverterCollection, IPublishedModelFactory, IPublishedContentTypeFactory)

    This constructor is for tests and is not intended to be used directly from application code.

    Declaration
    public PublishedPropertyType(string propertyTypeAlias, int dataTypeId, bool isUserProperty, ContentVariation variations, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)
    Parameters
    Type Name Description
    System.String propertyTypeAlias
    System.Int32 dataTypeId
    System.Boolean isUserProperty
    ContentVariation variations
    PropertyValueConverterCollection propertyValueConverters
    IPublishedModelFactory publishedModelFactory
    IPublishedContentTypeFactory factory
    Remarks

    Values are assumed to be consistent and are not checked.

    The new published property type does not belong to a published content type.

    View Source

    PublishedPropertyType(IPublishedContentType, String, Int32, Boolean, ContentVariation, PropertyValueConverterCollection, IPublishedModelFactory, IPublishedContentTypeFactory)

    This constructor is for tests and is not intended to be used directly from application code.

    Declaration
    public PublishedPropertyType(IPublishedContentType contentType, string propertyTypeAlias, int dataTypeId, bool isUserProperty, ContentVariation variations, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)
    Parameters
    Type Name Description
    IPublishedContentType contentType
    System.String propertyTypeAlias
    System.Int32 dataTypeId
    System.Boolean isUserProperty
    ContentVariation variations
    PropertyValueConverterCollection propertyValueConverters
    IPublishedModelFactory publishedModelFactory
    IPublishedContentTypeFactory factory
    Remarks

    Values are assumed to be consisted and are not checked.

    The new published property type belongs to the published content type.

    View Source

    PublishedPropertyType(IPublishedContentType, IPropertyType, PropertyValueConverterCollection, IPublishedModelFactory, IPublishedContentTypeFactory)

    Initialize a new instance of the PublishedPropertyType class with a property type.

    Declaration
    public PublishedPropertyType(IPublishedContentType contentType, IPropertyType propertyType, PropertyValueConverterCollection propertyValueConverters, IPublishedModelFactory publishedModelFactory, IPublishedContentTypeFactory factory)
    Parameters
    Type Name Description
    IPublishedContentType contentType
    IPropertyType propertyType
    PropertyValueConverterCollection propertyValueConverters
    IPublishedModelFactory publishedModelFactory
    IPublishedContentTypeFactory factory
    Remarks

    The new published property type belongs to the published content type.

    Properties

    View Source

    Alias

    Gets property type alias.

    Declaration
    public string Alias { get; }
    Property Value
    Type Description
    System.String
    View Source

    CacheLevel

    Gets the property cache level.

    Declaration
    public PropertyCacheLevel CacheLevel { get; }
    Property Value
    Type Description
    PropertyCacheLevel
    View Source

    ClrType

    Gets the property CLR type.

    Declaration
    public Type? ClrType { get; }
    Property Value
    Type Description
    System.Nullable<Type>
    Remarks

    Returns the actual CLR type which does not contain ModelType types.

    Mapping from ModelClrType may throw if some ModelType instances could not be mapped to actual CLR types.

    View Source

    ContentType

    Gets the published content type containing the property type.

    Declaration
    public IPublishedContentType ContentType { get; }
    Property Value
    Type Description
    IPublishedContentType
    View Source

    DataType

    Gets the data type.

    Declaration
    public PublishedDataType DataType { get; }
    Property Value
    Type Description
    PublishedDataType
    View Source

    DeliveryApiCacheLevel

    Gets the property cache level for Delivery API representation.

    Declaration
    public PropertyCacheLevel DeliveryApiCacheLevel { get; }
    Property Value
    Type Description
    PropertyCacheLevel
    View Source

    DeliveryApiCacheLevelForExpansion

    Gets the property cache level for Delivery API representation when expanding the property.

    Declaration
    public PropertyCacheLevel DeliveryApiCacheLevelForExpansion { get; }
    Property Value
    Type Description
    PropertyCacheLevel
    Remarks

    Defaults to the value of DeliveryApiCacheLevel.

    View Source

    DeliveryApiModelClrType

    Gets the property model Delivery Api CLR type.

    Declaration
    public Type DeliveryApiModelClrType { get; }
    Property Value
    Type Description
    Type
    Remarks

    The model CLR type may be a ModelType type, or may contain ModelType types.

    View Source

    EditorAlias

    Gets the property editor alias.

    Declaration
    public string EditorAlias { get; }
    Property Value
    Type Description
    System.String
    View Source

    EditorUiAlias

    Gets the property editor UI alias.

    Declaration
    public string EditorUiAlias { get; }
    Property Value
    Type Description
    System.String
    View Source

    IsUserProperty

    Gets a value indicating whether the property is a user content property.

    Declaration
    public bool IsUserProperty { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    A non-user content property is a property that has been added to a published content type by Umbraco but does not corresponds to a user-defined published property.

    View Source

    ModelClrType

    Gets the property model CLR type.

    Declaration
    public Type ModelClrType { get; }
    Property Value
    Type Description
    Type
    Remarks

    The model CLR type may be a ModelType type, or may contain ModelType types.

    For the actual CLR type, see ClrType.

    View Source

    Variations

    Gets the content variations of the property type.

    Declaration
    public ContentVariation Variations { get; }
    Property Value
    Type Description
    ContentVariation

    Methods

    View Source

    ConvertInterToDeliveryApiObject(IPublishedElement, PropertyCacheLevel, Object, Boolean, Boolean)

    Converts the intermediate value into the object value for Delivery API representation.

    Declaration
    public object ConvertInterToDeliveryApiObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview, bool expanding)
    Parameters
    Type Name Description
    IPublishedElement owner

    The published element owning the property.

    PropertyCacheLevel referenceCacheLevel

    The reference cache level.

    System.Object inter

    The intermediate value.

    System.Boolean preview

    A value indicating whether content should be considered draft.

    System.Boolean expanding

    A value indicating whether the property value should be expanded.

    Returns
    Type Description
    System.Object

    The object value.

    View Source

    ConvertInterToObject(IPublishedElement, PropertyCacheLevel, Object, Boolean)

    Converts the intermediate value into the object value.

    Declaration
    public object ConvertInterToObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
    Parameters
    Type Name Description
    IPublishedElement owner

    The published element owning the property.

    PropertyCacheLevel referenceCacheLevel

    The reference cache level.

    System.Object inter

    The intermediate value.

    System.Boolean preview

    A value indicating whether content should be considered draft.

    Returns
    Type Description
    System.Object

    The object value.

    View Source

    ConvertSourceToInter(IPublishedElement, Object, Boolean)

    Converts the source value into the intermediate value.

    Declaration
    public object ConvertSourceToInter(IPublishedElement owner, object source, bool preview)
    Parameters
    Type Name Description
    IPublishedElement owner

    The published element owning the property.

    System.Object source

    The source value.

    System.Boolean preview

    A value indicating whether content should be considered draft.

    Returns
    Type Description
    System.Object

    The intermediate value.

    View Source

    IsValue(Object, PropertyValueLevel)

    Determines whether a value is an actual value, or not a value.

    Declaration
    public bool? IsValue(object value, PropertyValueLevel level)
    Parameters
    Type Name Description
    System.Object value
    PropertyValueLevel level
    Returns
    Type Description
    System.Nullable<System.Boolean>
    Remarks

    Used by property.HasValue and, for instance, in fallback scenarios.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • PublishedPropertyType(String, Int32, Boolean, ContentVariation, PropertyValueConverterCollection, IPublishedModelFactory, IPublishedContentTypeFactory)
      • PublishedPropertyType(IPublishedContentType, String, Int32, Boolean, ContentVariation, PropertyValueConverterCollection, IPublishedModelFactory, IPublishedContentTypeFactory)
      • PublishedPropertyType(IPublishedContentType, IPropertyType, PropertyValueConverterCollection, IPublishedModelFactory, IPublishedContentTypeFactory)
    • Properties
      • Alias
      • CacheLevel
      • ClrType
      • ContentType
      • DataType
      • DeliveryApiCacheLevel
      • DeliveryApiCacheLevelForExpansion
      • DeliveryApiModelClrType
      • EditorAlias
      • EditorUiAlias
      • IsUserProperty
      • ModelClrType
      • Variations
    • Methods
      • ConvertInterToDeliveryApiObject(IPublishedElement, PropertyCacheLevel, Object, Boolean, Boolean)
      • ConvertInterToObject(IPublishedElement, PropertyCacheLevel, Object, Boolean)
      • ConvertSourceToInter(IPublishedElement, Object, Boolean)
      • IsValue(Object, PropertyValueLevel)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX