Class ContentTypeAttribute
The attribute class used to identify content types.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.DataAnnotations
Assembly: EPiServer.dll
Version: 11.20.7Syntax
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public class ContentTypeAttribute : Attribute, _Attribute
Remarks
Refer to "Attributes" and "Pages, Page Types and Page Templates" under "Content" in the Developer Guide for more information and examples.
Constructors
ContentTypeAttribute()
Declaration
public ContentTypeAttribute()
Properties
AvailableInEditMode
Gets or sets wether the corresponding ContentType is available in edit mode.
Declaration
public bool AvailableInEditMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Use GetAvailableInEditMode() to check if a value has been assigned.
This setting only affects if a type should be available to create in edit mode, it could still be available to edit if it has already been created or if a block is part of a page.
Description
Gets or sets the Description for the corresponding ContentType.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description. |
DisplayName
Gets or sets the DisplayName for the corresponding ContentType.
Declaration
public string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name. |
GroupName
Gets or sets a value that is used to group fields.
Declaration
public string GroupName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the group. |
GUID
Gets or sets the unique id for the corresponding ContentType.
Declaration
public string GUID { get; set; }
Property Value
Type | Description |
---|---|
System.String | The unique id of the ContentType. Default value is |
Remarks
Use GetGUID() to check if a value has been assigned.
Order
Gets or sets the Order for the corresponding ContentType.
Declaration
public int Order { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The sort order or the ContentType, default value is |
Remarks
Use GetOrder() to check if a value has been assigned.
Methods
GetAvailableInEditMode()
Returns the nullable bool for the corresponding property AvailableInEditMode.
Declaration
public bool? GetAvailableInEditMode()
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> |
Remarks
If the usage of the attribute has not set the AvailableInEditMode property this will not have any value.
GetGUID()
Returns the nullable Guid for the corresponding property GUID.
Declaration
public Guid? GetGUID()
Returns
Type | Description |
---|---|
System.Nullable<System.Guid> |
Remarks
If the usage of the attribute has not set the GUID property this will not have any value.
GetOrder()
Returns the nullable int for the corresponding property Order.
Declaration
public int? GetOrder()
Returns
Type | Description |
---|---|
System.Nullable<System.Int32> |
Remarks
If the usage of the attribute has not set the Order property this will not have any value.