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

Class PropertyList<T>

Base class intended to be used for list properties with custom item types.

Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public class PropertyList<T> : PropertyList, IReadOnly<PropertyData>, IReadOnly, ILazyProperty
Type Parameters
Name Description
T

Constructors

PropertyList()

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

Declaration
public PropertyList()

PropertyList(IEnumerable<T>)

Initializes a new instance of the PropertyList<T> class with the provided list.

Declaration
public PropertyList(IEnumerable<T> list)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T> list

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

ItemComparer

Gets the comparer that should be used to verify if items in the list unchanged after list has been altered. Replace if specific comparison is needed.

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

List

Gets or sets the list value of this property.

Declaration
public virtual IList<T> List { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<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

StringRepresentationSeparator

Gets the separator char that should be used when creating the string representation of this list.

Declaration
protected virtual char StringRepresentationSeparator { get; }
Property Value
Type Description
System.Char

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 or null if the property has no value defined.

Overrides

Methods

Copy()

Creates a copy of this object.

Declaration
public override PropertyData Copy()
Returns
Type Description
PropertyData

A 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

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 the list item type T. String is checked for null or empty values before called.

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

The string value that should be parsed.

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

ToString()

Get the property's values display string.

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides

Explicit Interface Implementations

ILazyProperty.AssignValueFactory(Func<Object>)

Declaration
void ILazyProperty.AssignValueFactory(Func<object> valueFactory)
Parameters
Type Name Description
System.Func<System.Object> valueFactory

ILazyProperty.HasLazyValue

Declaration
bool ILazyProperty.HasLazyValue { get; }
Returns
Type Description
System.Boolean

Implements

Extension Methods