November Happy Hour will be moved to Thursday December 5th.

Class PropertyBlock<T>

A Property that wraps a BlockData object.

Inheritance
System.Object
PropertyBlock<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.SpecializedProperties
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public class PropertyBlock<T> : PropertyBlock, IReadOnly<PropertyData>, IReadOnly, IPersonalizedRoles, IPropertyBlock<T>, IPropertyBlock, IContentData where T : BlockData
Type Parameters
Name Description
T

Constructors

PropertyBlock()

Initializes a new instance of the PropertyBlock<T> class.

Declaration
public PropertyBlock()

PropertyBlock(T)

Initializes a new instance of the PropertyBlock<T> class.

Declaration
public PropertyBlock(T blockData)
Parameters
Type Name Description
T blockData

The block data.

Properties

Block

Gets or sets the block data that is the value of the property.

Declaration
public virtual T Block { get; set; }
Property Value
Type Description
T
Remarks

It returns an empty BlockData if the property has no value defined.

BlockPropertyDefinitionTypeID

Gets the ID for the BlockPropertyDefinitionType that this property instance corresponds to.

Declaration
public int BlockPropertyDefinitionTypeID { get; set; }
Property Value
Type Description
System.Int32

The block property definition type ID.

Remarks

This is mainly used for Dynamic Blocks. For ContentType properties the PropertyDefinition for the property can be used to get PropertyDefinitionType

BlockType

Gets the type of the block

Declaration
public virtual Type BlockType { get; }
Property Value
Type Description
System.Type

The type of the block.

IsLanguageSpecific

Test if this property is specific to a language in multilanguage configuration.

Declaration
public override bool IsLanguageSpecific { get; set; }
Property Value
Type Description
System.Boolean

true if this instance is language specific; otherwise, false.

Overrides
Remarks

A property block is considered language specific if any of its child properties are language specific.

IsModified

Check if property has been modified.

Declaration
public override bool IsModified { get; set; }
Property Value
Type Description
System.Boolean

true if this instance is modified; otherwise, false.

Overrides

IsNull

Check for null property (no value has been set).

Declaration
public override bool IsNull { get; }
Property Value
Type Description
System.Boolean

true if the Block has zero properties; otherwise, false.

Overrides

Property

Gets a collection of all content properties in the IContentData.

Declaration
public virtual PropertyDataCollection Property { get; }
Property Value
Type Description
PropertyDataCollection

PropertyValueType

Gets the System.Type of the property value.

Declaration
public override Type PropertyValueType { get; }
Property Value
Type Description
System.Type

The System.Type of BlockData.

Overrides

Type

Property type as defined by enum PropertyDataType.

Declaration
public override PropertyDataType Type { get; }
Property Value
Type Description
PropertyDataType

Returns Block.

Overrides

Value

Gets or sets the value of the property.

Declaration
public override object Value { get; set; }
Property Value
Type Description
System.Object
Overrides
Remarks

Value returns null if the property has no value defined.

Methods

CreateWritableClone()

Creates a writable clone of the property.

Declaration
public override PropertyData CreateWritableClone()
Returns
Type Description
PropertyData

A writable copy of the property.

Overrides

GetRoles()

Gets all used personalized content roles by asking what roles are used on the properties of this block.

Declaration
public IEnumerable<string> GetRoles()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

A list of all used personalized content roles.

MakeReadOnly()

Sets internal BlockData to read-only as well as calling the base class

Declaration
public override void MakeReadOnly()
Overrides

ParseToSelf(String)

Not supported yet

Declaration
public override void ParseToSelf(string value)
Parameters
Type Name Description
System.String value
Overrides

ResetModified()

Resets the modified flag on all the properties in the Property collection.

Declaration
public void ResetModified()

SetDefaultValue()

Sets the default value for this property.

Declaration
protected override void SetDefaultValue()
Overrides
Remarks

The default value is an empty instance of T which is of BlockData.

Explicit Interface Implementations

IPropertyBlock.Block

Gets or sets the block.

Declaration
BlockData IPropertyBlock.Block { get; set; }
Returns
Type Description
BlockData

The block.

Implements

Extension Methods

EPiServer.Core.IContentExtensions.GetPropertyName<TContent>(TContent, System.Linq.Expressions.Expression<System.Func<TContent, System.Object>>)
EPiServer.Core.PropertyDataExtensions.TranslateDisplayName(EPiServer.Core.PropertyData)
EPiServer.Core.PropertyDataExtensions.TranslateDescription(EPiServer.Core.PropertyData)