Class AvailableContentTypesAttribute

Defines which content types that should be available under a ContentType

Inheritance
System.Object
System.Attribute
AvailableContentTypesAttribute
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: 8.11.0
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class AvailableContentTypesAttribute : Attribute, _Attribute, IContentTypeAvailableModelSetting
Remarks

The diffent properties of the attribute are applied in the following way:

  • Include implicitly exclude all PageTypes not in the list.
  • Exclude implicitly include all PageTypes not in the list.
  • IncludeOn and ExcludeOn combine with the settings on the target PageType. If there is a conflict Exclude/ExcludeOn have precedency over Include/IncludeOn.

Refer to "Attributes" and "Pages, Page Types and Page Templates" under "Content" in the Developer Guide for more information and examples.

Examples

Here is an example on how you can set available page types on your page types using this attribute.

Constructors

AvailableContentTypesAttribute()

Initializes a new instance of the AvailableContentTypesAttribute class.

Declaration
public AvailableContentTypesAttribute()

AvailableContentTypesAttribute(Availability)

Initializes a new instance of the AvailableContentTypesAttribute class.

Declaration
public AvailableContentTypesAttribute(Availability availability)
Parameters
Type Name Description
Availability availability

Properties

Availability

Gets or sets wether none ContentType should be available to create under the ContentType that has this attribute set.

Declaration
public Availability Availability { get; set; }
Property Value
Type Description
Availability

true if no ContentType is available; otherwise, false.

Exclude

Gets or sets the typed pages that are not available under an instance of a page of corresponding PageType.

Declaration
public Type[] Exclude { get; set; }
Property Value
Type Description
System.Type[]

The available page types.

ExcludeOn

Will exclude the typed page from the list of available ContentType for the specified typed pages.

Declaration
public Type[] ExcludeOn { get; set; }
Property Value
Type Description
System.Type[]

The available page types.

Include

Gets or sets the typed pages that are available under an instance of a page of corresponding ContentType.

Declaration
public Type[] Include { get; set; }
Property Value
Type Description
System.Type[]

The available page types.

IncludeOn

Will make the typed page available as child under the specified typed pages.

Declaration
public Type[] IncludeOn { get; set; }
Property Value
Type Description
System.Type[]

The available page types.

Implements

System.Runtime.InteropServices._Attribute

Extension Methods

See Also

PageTypeAttribute
AccessAttribute