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

Class ContentTypeAttribute

The attribute class used to identify content types.

Inheritance
System.Object
System.Attribute
ContentTypeAttribute
Implements
System.Runtime.InteropServices._Attribute
Inherited Members
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.Equals(System.Object)
System.Attribute.GetHashCode()
System.Attribute.Match(System.Object)
System.Attribute.IsDefaultAttribute()
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)
System.Attribute.TypeId
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAnnotations
Assembly: EPiServer.dll
Version: 10.10.4
Syntax
[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

true if the ContentType is available in edit mode; otherwise, false. Default value is true.

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 null.

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 0.

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.

Implements

System.Runtime.InteropServices._Attribute

Extension Methods