Class ContentTypeCompositionBase
Represents an abstract class for composition specific ContentType properties and methods
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public abstract class ContentTypeCompositionBase : ContentTypeBase, IContentTypeComposition, IContentTypeBase, IUmbracoEntity, IAggregateRoot, IDeletableEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
ContentTypeCompositionBase(Int32)
Declaration
protected ContentTypeCompositionBase(int parentId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | parentId |
ContentTypeCompositionBase(IContentTypeComposition)
Declaration
protected ContentTypeCompositionBase(IContentTypeComposition parent)
Parameters
Type | Name | Description |
---|---|---|
IContentTypeComposition | parent |
ContentTypeCompositionBase(IContentTypeComposition, String)
Declaration
protected ContentTypeCompositionBase(IContentTypeComposition parent, string alias)
Parameters
Type | Name | Description |
---|---|---|
IContentTypeComposition | parent | |
System.String | alias |
Properties
CompositionPropertyGroups
Gets the property groups for the entire composition.
Declaration
[IgnoreDataMember]
public IEnumerable<PropertyGroup> CompositionPropertyGroups { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyGroup> |
CompositionPropertyTypes
Gets the property types for the entire composition.
Declaration
[IgnoreDataMember]
public IEnumerable<PropertyType> CompositionPropertyTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyType> |
ContentTypeComposition
Gets or sets the content types that compose this content type.
Declaration
[DataMember]
public IEnumerable<IContentTypeComposition> ContentTypeComposition { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IContentTypeComposition> |
Methods
AddContentType(IContentTypeComposition)
Adds a content type to the composition.
Declaration
public bool AddContentType(IContentTypeComposition contentType)
Parameters
Type | Name | Description |
---|---|---|
IContentTypeComposition | contentType | The content type to add. |
Returns
Type | Description |
---|---|
System.Boolean | True if the content type was added, otherwise false. |
AddPropertyGroup(String)
Adds a PropertyGroup.
Declaration
public override bool AddPropertyGroup(string groupName)
Parameters
Type | Name | Description |
---|---|---|
System.String | groupName | Name of the PropertyGroup to add |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
AddPropertyType(PropertyType, String)
Adds a PropertyType to a specific PropertyGroup
Declaration
public override bool AddPropertyType(PropertyType propertyType, string propertyGroupName)
Parameters
Type | Name | Description |
---|---|---|
PropertyType | propertyType | PropertyType to add |
System.String | propertyGroupName | Name of the PropertyGroup to add the PropertyType to |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
CompositionAliases()
Gets a list of ContentType aliases from the current composition
Declaration
public IEnumerable<string> CompositionAliases()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | An enumerable list of string aliases |
Remarks
Does not contain the alias of the Current ContentType
CompositionIds()
Gets a list of ContentType Ids from the current composition
Declaration
public IEnumerable<int> CompositionIds()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Int32> | An enumerable list of integer ids |
Remarks
Does not contain the Id of the Current ContentType
ContentTypeCompositionExists(String)
Checks if a ContentType with the supplied alias exists in the list of composite ContentTypes
Declaration
public bool ContentTypeCompositionExists(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | Alias of a ContentType |
Returns
Type | Description |
---|---|
System.Boolean | True if ContentType with alias exists, otherwise returns False |
DeepClone()
Declaration
public override object DeepClone()
Returns
Type | Description |
---|---|
System.Object |
PropertyTypeExists(String)
Checks whether a PropertyType with a given alias already exists
Declaration
public override bool PropertyTypeExists(string propertyTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyTypeAlias | Alias of the PropertyType |
Returns
Type | Description |
---|---|
System.Boolean | Returns |
RemoveContentType(String)
Removes a content type with a specified alias from the composition.
Declaration
public bool RemoveContentType(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | The alias of the content type to remove. |
Returns
Type | Description |
---|---|
System.Boolean | True if the content type was removed, otherwise false. |