Search Results for

    Show / Hide Table of Contents
    View Source

    Class PropertyType

    Represents a property type.

    Inheritance
    System.Object
    BeingDirtyBase
    EntityBase
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(IsReference = true)]
    public class PropertyType : EntityBase, IPropertyType, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty

    Constructors

    View Source

    PropertyType(IShortStringHelper, String, ValueStorageType)

    Initializes a new instance of the PropertyType class.

    Declaration
    public PropertyType(IShortStringHelper shortStringHelper, string propertyEditorAlias, ValueStorageType valueStorageType)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    System.String propertyEditorAlias
    ValueStorageType valueStorageType
    View Source

    PropertyType(IShortStringHelper, String, ValueStorageType, Boolean, String)

    Initializes a new instance of the PropertyType class.

    Declaration
    public PropertyType(IShortStringHelper shortStringHelper, string propertyEditorAlias, ValueStorageType valueStorageType, bool forceValueStorageType, string propertyTypeAlias = null)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    System.String propertyEditorAlias
    ValueStorageType valueStorageType
    System.Boolean forceValueStorageType
    System.String propertyTypeAlias
    Remarks

    Set forceValueStorageType to true to force the value storage type. Values assigned to the property, eg from the underlying datatype, will be ignored.

    View Source

    PropertyType(IShortStringHelper, String, ValueStorageType, String)

    Initializes a new instance of the PropertyType class.

    Declaration
    public PropertyType(IShortStringHelper shortStringHelper, string propertyEditorAlias, ValueStorageType valueStorageType, string propertyTypeAlias)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    System.String propertyEditorAlias
    ValueStorageType valueStorageType
    System.String propertyTypeAlias
    View Source

    PropertyType(IShortStringHelper, IDataType)

    Initializes a new instance of the PropertyType class.

    Declaration
    public PropertyType(IShortStringHelper shortStringHelper, IDataType dataType)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    IDataType dataType
    View Source

    PropertyType(IShortStringHelper, IDataType, String)

    Initializes a new instance of the PropertyType class.

    Declaration
    public PropertyType(IShortStringHelper shortStringHelper, IDataType dataType, string propertyTypeAlias)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    IDataType dataType
    System.String propertyTypeAlias

    Properties

    View Source

    Alias

    Gets of sets the alias of the property type.

    Declaration
    [DataMember]
    public virtual string Alias { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    DataTypeId

    Gets or sets the identifier of the datatype for this property type.

    Declaration
    [DataMember]
    public int DataTypeId { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    DataTypeKey

    Declaration
    [DataMember]
    public Guid DataTypeKey { get; set; }
    Property Value
    Type Description
    Guid
    View Source

    Description

    Gets of sets the description of the property type.

    Declaration
    [DataMember]
    public string Description { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    LabelOnTop

    Gets or sets a value indicating whether the label of this property type should be displayed on top.

    Declaration
    [DataMember]
    public bool LabelOnTop { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Mandatory

    Gets of sets a value indicating whether a value for this property type is required.

    Declaration
    [DataMember]
    public bool Mandatory { get; set; }
    Property Value
    Type Description
    System.Boolean
    View Source

    MandatoryMessage

    Gets or sets the custom validation message used when a value for this PropertyType is required

    Declaration
    [DataMember]
    public string MandatoryMessage { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    Name

    Gets of sets the name of the property type.

    Declaration
    [DataMember]
    public string Name { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    PropertyEditorAlias

    Gets or sets the alias of the property editor for this property type.

    Declaration
    [DataMember]
    public string PropertyEditorAlias { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    PropertyGroupId

    Gets or sets the identifier of the property group this property type belongs to.

    Declaration
    [DataMember]
    public Lazy<int>? PropertyGroupId { get; set; }
    Property Value
    Type Description
    System.Nullable<Lazy<System.Int32>>
    Remarks

    For generic properties, the value is null.

    View Source

    SortOrder

    Gets of sets the sort order of the property type.

    Declaration
    [DataMember]
    public int SortOrder { get; set; }
    Property Value
    Type Description
    System.Int32
    View Source

    SupportsPublishing

    Gets a value indicating whether the content type owning this property type is publishing.

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

    A publishing content type supports draft and published values for properties. It is possible to retrieve either the draft (default) or published value of a property. Setting the value always sets the draft value, which then needs to be published.

    A non-publishing content type only supports one value for properties. Getting the draft or published value of a property returns the same thing, and publishing a value property has no effect.

    When true, getting the property value returns the edited value by default, but it is possible to get the published value using the appropriate 'published' method parameter.

    When false, getting the property value always return the edited value, regardless of the 'published' method parameter.

    View Source

    ValidationRegExp

    Gets or sets the regular expression validating the property values.

    Declaration
    [DataMember]
    public string ValidationRegExp { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    ValidationRegExpMessage

    Gets or sets the custom validation message used when a pattern for this PropertyType must be matched

    Declaration
    [DataMember]
    public string ValidationRegExpMessage { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    ValueStorageType

    Gets or sets the database type for storing value for this property type.

    Declaration
    [DataMember]
    public ValueStorageType ValueStorageType { get; set; }
    Property Value
    Type Description
    ValueStorageType
    View Source

    Variations

    Gets or sets the content variation of the property type.

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

    Methods

    View Source

    Equals(PropertyType)

    Declaration
    public bool Equals(PropertyType other)
    Parameters
    Type Name Description
    PropertyType other
    Returns
    Type Description
    System.Boolean
    View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    View Source

    PerformDeepClone(Object)

    Used by inheritors to modify the DeepCloning logic

    Declaration
    protected override void PerformDeepClone(object clone)
    Parameters
    Type Name Description
    System.Object clone
    View Source

    SupportsVariation(String, String, Boolean)

    Determines whether the property type supports a combination of culture and segment.

    Declaration
    public bool SupportsVariation(string culture, string segment, bool wildcards = false)
    Parameters
    Type Name Description
    System.String culture

    The culture.

    System.String segment

    The segment.

    System.Boolean wildcards

    A value indicating whether wildcards are valid.

    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • PropertyType(IShortStringHelper, String, ValueStorageType)
      • PropertyType(IShortStringHelper, String, ValueStorageType, Boolean, String)
      • PropertyType(IShortStringHelper, String, ValueStorageType, String)
      • PropertyType(IShortStringHelper, IDataType)
      • PropertyType(IShortStringHelper, IDataType, String)
    • Properties
      • Alias
      • DataTypeId
      • DataTypeKey
      • Description
      • LabelOnTop
      • Mandatory
      • MandatoryMessage
      • Name
      • PropertyEditorAlias
      • PropertyGroupId
      • SortOrder
      • SupportsPublishing
      • ValidationRegExp
      • ValidationRegExpMessage
      • ValueStorageType
      • Variations
    • Methods
      • Equals(PropertyType)
      • GetHashCode()
      • PerformDeepClone(Object)
      • SupportsVariation(String, String, Boolean)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX