Class Property<T>

NOTE: This is a pre-release API that is UNSTABLE and might not satisfy the compatibility requirements as denoted by its associated normal version. Base class used for properties of any custom type intended to be persisted as a serialized object.

Inheritance
System.Object
Property<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.Core
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public abstract class Property<T> : PropertyJson, IReadOnly<PropertyData>, IReadOnly where T : class
Type Parameters
Name Description
T

Constructors

Property()

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

Declaration
protected Property()

Property(T)

Initializes a new instance of the Property<T> class with the provided item.

Declaration
protected Property(T item)
Parameters
Type Name Description
T item

Properties

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 this property is null; otherwise, false.

Overrides

Item

Gets or sets the typed value item.

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

ItemComparer

Gets the comparer that should be used internally to verify if the item is the same as the current one. Replace the default if needed.

Declaration
protected virtual IEqualityComparer<T> ItemComparer { get; }
Property Value
Type Description
System.Collections.Generic.IEqualityComparer<T>

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

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.

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

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.

ParseItem(String)

Parses a string into an item of implemented type T. String is checked for null or empty values before called.

Declaration
protected abstract T ParseItem(string value)
Parameters
Type Name Description
System.String value

The string value.

Returns
Type Description
T
Remarks

This method should mirror the output of the ToString method of the type. Used for default value handling.

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