Class PropertyXhtmlString
A property representing a static or dynamic xhtml string value. This property has support to handle dynamic fragments like dynamic content, personalized content and permanent links.
Implements
Inherited Members
Namespace: EPiServer.SpecializedProperties
Assembly: EPiServer.dll
Version: 12.0.3Syntax
[PropertyDefinitionTypePlugIn]
public class PropertyXhtmlString : PropertyLongString, IReadOnly<PropertyData>, IReadOnly, ILazyProperty, IReferenceMap, IPropertyPreferLoadData, IPersonalizedRoles, IDeserializationCallback
Constructors
PropertyXhtmlString()
Initializes a new instance of the PropertyXhtmlString class.
Declaration
public PropertyXhtmlString()
PropertyXhtmlString(String)
Initializes a new instance of the PropertyXhtmlString class.
Declaration
public PropertyXhtmlString(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value. |
PropertyXhtmlString(String, IPrincipalAccessor)
Exposed for unit tests
Declaration
public PropertyXhtmlString(string value, IPrincipalAccessor principalAccessor)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | |
| IPrincipalAccessor | principalAccessor |
Properties
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
LongString
Gets or sets the string representation with normal links. This is how actual content is accessed. The setter will parse the content, and insert permanent links where appropriate. The getter will, if necessary, reparse the content to split it into the mixed list representation to speed up dynamic rendering of links.
Declaration
protected override string LongString { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The long string. |
Overrides
PropertyValueType
Gets the System.Type for this property.
Declaration
public override Type PropertyValueType { get; }
Property Value
| Type | Description |
|---|---|
| System.Type | The System.Type of the property value. |
Overrides
ReferencedPermanentLinkIds
Gets an System.Collections.Generic.IList<> of permanent link ids that are referenced from this property.
Declaration
public IList<Guid> ReferencedPermanentLinkIds { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<System.Guid> | An System.Collections.Generic.IList<> of permanent link ids that are referenced from this property. |
Value
The value of the property.
Declaration
public override object Value { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The value of the property. |
Overrides
Remarks
Value returns null if the property has no value defined.
XhtmlString
Gets or sets the XHTML string.
Declaration
public XhtmlString XhtmlString { get; set; }
Property Value
| Type | Description |
|---|---|
| XhtmlString | The XHTML string. |
Methods
Copy()
Creates a copy of this object.
Declaration
public override PropertyData Copy()
Returns
| Type | Description |
|---|---|
| PropertyData | A new PropertyData object. |
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 from it's fragments
Declaration
public virtual IEnumerable<string> GetRoles()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.String> | The names of all virtual roles that have personalized content in the property content. |
LoadData(Object)
Sets the internal representation from what is stored in the database. "Deserialize".
Declaration
public override void LoadData(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The internal value. |
Overrides
MakeReadOnly()
Override to avoid the base class referring to our Value property to avoid dead-lock when this happens indirectly via DataFactory.
Declaration
public override void MakeReadOnly()
Overrides
Parse(String)
Returns a new PropertyXhtmlString based on the string value.
Declaration
public static PropertyXhtmlString Parse(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value. |
Returns
| Type | Description |
|---|---|
| PropertyXhtmlString |
ParseToSelf(String)
Sets the LongString to the value.
Declaration
public override void ParseToSelf(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value. |
Overrides
RemapPermanentLinkReferences(IDictionary<Guid, Guid>)
Remaps permanent links according to the provided link mapping.
Declaration
public virtual void RemapPermanentLinkReferences(IDictionary<Guid, Guid> idMap)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary<System.Guid, System.Guid> | idMap | The link mapping. |
SaveData(PropertyDataCollection)
Get the data representation suitable for storing to the database. "Serialize".
Declaration
public override object SaveData(PropertyDataCollection properties)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyDataCollection | properties | The properties for the current page. |
Returns
| Type | Description |
|---|---|
| System.Object | A string representation of the xhtml where the permanent links have not been resolved. |
Overrides
Remarks
Returns with unresolved links
SetDefaultValue()
Sets the default value for this property.
Declaration
protected override void SetDefaultValue()
Overrides
ToWebString()
The Xhtml string representation for view mode.
Declaration
public override string ToWebString()
Returns
| Type | Description |
|---|---|
| System.String |