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

Class PropertyContentReference

Property representing a link to a content item.

Inheritance
System.Object
PropertyContentReference
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.Core
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public class PropertyContentReference : PropertyData, IReadOnly<PropertyData>, IReadOnly

Constructors

PropertyContentReference()

Initializes a new instance of the PropertyContentReference class.

Declaration
public PropertyContentReference()

PropertyContentReference(ContentReference)

Initializes a new instance of the PropertyContentReference class.

Declaration
public PropertyContentReference(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

PropertyContentReference(Guid)

Initializes a new instance of the PropertyContentReference class.

Declaration
public PropertyContentReference(Guid contentGuid)
Parameters
Type Name Description
System.Guid contentGuid

The page GUID.

PropertyContentReference(Int32)

Initializes a new instance of the PropertyContentReference class.

Declaration
public PropertyContentReference(int contentID)
Parameters
Type Name Description
System.Int32 contentID

The content ID.

PropertyContentReference(Int32, Int32)

Initializes a new instance of the PropertyContentReference class.

Declaration
public PropertyContentReference(int contentID, int workID)
Parameters
Type Name Description
System.Int32 contentID

The content ID.

System.Int32 workID

The work ID.

PropertyContentReference(Int32, Int32, String)

Initializes a new instance of the PropertyContentReference class.

Declaration
public PropertyContentReference(int contentID, int workID, string providerName)
Parameters
Type Name Description
System.Int32 contentID

The content ID.

System.Int32 workID

The work ID.

System.String providerName

Name of the provider.

PropertyContentReference(Int32, String)

Initializes a new instance of the PropertyContentReference class.

Declaration
public PropertyContentReference(int contentID, string providerName)
Parameters
Type Name Description
System.Int32 contentID

The content ID.

System.String providerName

Name of the provider.

Properties

Gets or sets the content link.

Declaration
public virtual ContentReference ContentLink { get; set; }
Property Value
Type Description
ContentReference

The content link.

GuidValue

Gets or sets the GUID value.

Declaration
public virtual Guid GuidValue { get; set; }
Property Value
Type Description
System.Guid

The GUID value.

ID

Gets or sets the ID for this content reference.

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

The ID for this content reference.

IsNull

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

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

true if this property is null; otherwise, false.

Overrides

IsSelfReference

Gets a value indicating whether this instance is self reference.

Declaration
public virtual bool IsSelfReference { get; }
Property Value
Type Description
System.Boolean

true if this instance is self reference; otherwise, false.

LinkMapper

Gets or sets the link mapper.

Declaration
public Injected<IPermanentLinkMapper> LinkMapper { get; set; }
Property Value
Type Description
Injected<IPermanentLinkMapper>

The link mapper.

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 the property value.

Overrides

ProviderName

Gets or sets the provider name for this content reference.

Declaration
public virtual string ProviderName { get; set; }
Property Value
Type Description
System.String

The provider name for this content reference.

Type

Property type as defined by enum PropertyDataType.

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

The type as defined by enum PropertyDataType.

Overrides

Value

Gets or sets 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.

WorkID

Gets or sets the work ID for this content reference.

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

The work ID for this content reference.

Methods

Copy()

Creates a copy of this object.

Declaration
public override PropertyData Copy()
Returns
Type Description
PropertyData

A PropertyData object.

Overrides

CreatePropertyControl()

Creates an IPropertyControl that is used to display a user interface for the property.

Declaration
public override IPropertyControl CreatePropertyControl()
Returns
Type Description
IPropertyControl

An IPropertyControl that is used to display a user interface for the property.

Overrides
Remarks

It is possible to change which control should be used by registering a different IPropertyControl for the PropertyData class in PropertyControlClassFactory.

CreateWritableClone()

Creates a writable clone of the property.

Declaration
public override PropertyData CreateWritableClone()
Returns
Type Description
PropertyData

A writable copy of the property.

Overrides

EnsureType(ContentReference)

Ensure that the type is of correct type.

Declaration
protected virtual ContentReference EnsureType(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The instance.

Returns
Type Description
ContentReference

A ContentReference or inherited type.

GetEmptyReference()

Gets an empty reference of the type stored in this property.

Declaration
protected virtual ContentReference GetEmptyReference()
Returns
Type Description
ContentReference

An empty ContentReference object.

MakeReadOnly()

Convert this property to ReadOnly

Declaration
public override void MakeReadOnly()
Overrides
Remarks

Implementors should override this method when exposing complex objects that should be read-only as well.

ParseToObject(String)

Creates a new instance of PropertyData with the given value, ie reversed ToString().

Declaration
public override PropertyData ParseToObject(string value)
Parameters
Type Name Description
System.String value

The string value to parse.

Returns
Type Description
PropertyData

A new instance of PropertyData with the given value.

Overrides

ParseToSelf(String)

Sets the value of the property from a string representation.

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

The string value to parse.

Overrides

SetDefaultValue()

Sets the default value for this property.

Declaration
protected override void SetDefaultValue()
Overrides

Implements

Extension Methods