Try our conversational search powered by Generative AI!

Class PropertyCategory

A property representing a category list.

Inheritance
System.Object
PropertyCategory
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: 11.20.7
Syntax
public class PropertyCategory : PropertyData, IReadOnly<PropertyData>, IReadOnly
Remarks

If you wish to change values of this class, you normally want to access the Category property. The Value property will return a CategoryList if it is not set to null.

Constructors

PropertyCategory()

Initializes a new instance of the PropertyCategory class.

Declaration
public PropertyCategory()

PropertyCategory(CategoryList)

Initializes a new instance of the PropertyCategory class.

Declaration
public PropertyCategory(CategoryList categories)
Parameters
Type Name Description
CategoryList categories

The initial value.

Properties

Category

The typed value accessor.

Declaration
public CategoryList Category { get; set; }
Property Value
Type Description
CategoryList

The value for the property as a CategoryList.

CategoryNames

Gets or sets the categories as a string array containing the names of the categories.

Declaration
public string[] CategoryNames { get; set; }
Property Value
Type Description
System.String[]

The categories as a string array containing the names of the categories.

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

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

Get the PropertyDataType for this property.

Declaration
public override PropertyDataType Type { get; }
Property Value
Type Description
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

Copy()

Creates a copy of this object.

Declaration
public override PropertyData Copy()
Returns
Type Description
PropertyData

A PropertyCategory 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

GetAvailableCategories()

Get the categories that are used to create the category list, which is done in CreateChildControls. By default all categories are fetched. Override this function to define your own category list.

Declaration
public virtual IList GetAvailableCategories()
Returns
Type Description
System.Collections.IList

A category collection that implements IList. Internally the collection is created by EPiServer.DataAbstraction.Category.GetRoot().GetList().

MakeReadOnly()

Sets internal CategoryList to read-only as well as calling the base class

Declaration
public override void MakeReadOnly()
Overrides

Parse(String)

Create a new PropertyCategory from a string representation of categories.

Declaration
public static PropertyCategory Parse(string str)
Parameters
Type Name Description
System.String str

The string to create a PropertyCategory from.

Returns
Type Description
PropertyCategory

The new PropertyCategory object.

Remarks

The string should be in the form of a comma-separated string, i e "1,12,34".

ParseToObject(String)

Read property data from a string representation, ie reversed ToString().

Declaration
[Obsolete("ParseToObject is no longer required to be implemented. The same functionality can be achieved by creating a new instance and calling the ParseToSelf method.")]
public override PropertyData ParseToObject(string value)
Parameters
Type Name Description
System.String value

The string to parse.

Returns
Type Description
PropertyData

A new instance of PropertyData.

Overrides
Remarks

The string should be in the form of a comma-separated string, i e "1,12,34".

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
Remarks

The string should be in the form of a comma-separated string, i e "1,12,34".

SetDefaultValue()

Sets the default value for this property.

Declaration
protected override void SetDefaultValue()
Overrides

ToString()

Gets the property's value as a string.

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

The string will be in the form of a comma-separated string, i e "1,12,34".

ToWebString()

Get the web string representation of the property's value, on properties that do not use the editor this string will not contain any markup characters.

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

A string where all html tags except those defined in 'EPiServer.Configuration.Settings.UISafeHtmlTags' have been encoded and therefore will appear in the text instead of tags.

Overrides

Implements

Extension Methods

EPiServer.Core.PropertyDataExtensions.TranslateDisplayName(EPiServer.Core.PropertyData)
EPiServer.Core.PropertyDataExtensions.TranslateDescription(EPiServer.Core.PropertyData)