Class PropertyBlock<T>
A Property that wraps a BlockData object.
Implements
Inherited Members
Namespace: EPiServer.SpecializedProperties
Assembly: EPiServer.dll
Version: 10.10.4Syntax
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 |
|
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 |
|
Overrides
IsNull
Check for null property (no value has been set).
Declaration
public override bool IsNull { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
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
CreatePropertyControl()
Creates an IPropertyControl that is used to display a user interface for the property.
Declaration
[Obsolete("Use IPropertyControlFactory to create property controls")]
public override IPropertyControl CreatePropertyControl()
Returns
Type | Description |
---|---|
IPropertyControl | An IPropertyControl that is used to display a user interface for the property. |
Overrides
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
ParseToObject(String)
Not supported yet
Declaration
public override PropertyData ParseToObject(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value |
Returns
Type | Description |
---|---|
PropertyData |
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. |