Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentTypeCompositionBase

    Represents an abstract class for composition specific ContentType properties and methods

    Inheritance
    System.Object
    BeingDirtyBase
    EntityBase
    TreeEntityBase
    ContentTypeBase
    Namespace: Umbraco.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [Serializable]
    [DataContract(IsReference = true)]
    public abstract class ContentTypeCompositionBase : ContentTypeBase, IContentTypeComposition, IContentTypeBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty

    Constructors

    View Source

    ContentTypeCompositionBase(Int32)

    Declaration
    protected ContentTypeCompositionBase(int parentId)
    Parameters
    Type Name Description
    System.Int32 parentId
    View Source

    ContentTypeCompositionBase(IContentTypeComposition)

    Declaration
    protected ContentTypeCompositionBase(IContentTypeComposition parent)
    Parameters
    Type Name Description
    IContentTypeComposition parent
    View Source

    ContentTypeCompositionBase(IContentTypeComposition, String)

    Declaration
    protected ContentTypeCompositionBase(IContentTypeComposition parent, string alias)
    Parameters
    Type Name Description
    IContentTypeComposition parent
    System.String alias

    Properties

    View Source

    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>
    View Source

    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>
    View Source

    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

    View Source

    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.

    View Source

    AddPropertyGroup(String)

    Adds a property group with the alias based on the specified groupName.

    Declaration
    [Obsolete("Use AddPropertyGroup(alias, name) instead to explicitly set the alias (note the slighty different parameter order).")]
    public override bool AddPropertyGroup(string groupName)
    Parameters
    Type Name Description
    System.String groupName

    Name of the group.

    Returns
    Type Description
    System.Boolean

    Returns true if a property group with specified groupName was added; otherwise, false.

    Remarks

    This method will also check if a group already exists with the same alias.

    View Source

    AddPropertyGroup(String, String)

    Adds a property group with the specified name and alias.

    Declaration
    public override bool AddPropertyGroup(string alias, string name)
    Parameters
    Type Name Description
    System.String alias

    The alias.

    System.String name

    Name of the group.

    Returns
    Type Description
    System.Boolean

    Returns true if a property group with specified alias was added; otherwise, false.

    Remarks

    This method will also check if a group already exists with the same alias.

    View Source

    AddPropertyType(PropertyType, String)

    Adds the property type to the specified property group (creates a new group if not found).

    Declaration
    [Obsolete("Use AddPropertyType(propertyType, groupAlias, groupName) instead to explicitly set the alias of the group (note the slighty different parameter order).")]
    public override bool AddPropertyType(PropertyType propertyType, string propertyGroupName)
    Parameters
    Type Name Description
    PropertyType propertyType

    The property type to add.

    System.String propertyGroupName

    The name of the property group to add the property type to.

    Returns
    Type Description
    System.Boolean

    Returns true if the property type was added; otherwise, false.

    View Source

    AddPropertyType(PropertyType, String, String)

    Adds the property type to the specified property group (creates a new group if not found and a name is specified).

    Declaration
    public override bool AddPropertyType(PropertyType propertyType, string groupAlias, string groupName)
    Parameters
    Type Name Description
    PropertyType propertyType

    The property type to add.

    System.String groupAlias

    The alias of the property group to add the property type to.

    System.String groupName

    The name of the property group to create when not found.

    Returns
    Type Description
    System.Boolean

    Returns true if the property type was added; otherwise, false.

    View Source

    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

    View Source

    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

    View Source

    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

    View Source

    PerformDeepClone(Object)

    Declaration
    protected override void PerformDeepClone(object clone)
    Parameters
    Type Name Description
    System.Object clone
    View Source

    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 True if a PropertyType with the passed in alias exists, otherwise False

    View Source

    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.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ContentTypeCompositionBase(Int32)
      • ContentTypeCompositionBase(IContentTypeComposition)
      • ContentTypeCompositionBase(IContentTypeComposition, String)
    • Properties
      • CompositionPropertyGroups
      • CompositionPropertyTypes
      • ContentTypeComposition
    • Methods
      • AddContentType(IContentTypeComposition)
      • AddPropertyGroup(String)
      • AddPropertyGroup(String, String)
      • AddPropertyType(PropertyType, String)
      • AddPropertyType(PropertyType, String, String)
      • CompositionAliases()
      • CompositionIds()
      • ContentTypeCompositionExists(String)
      • PerformDeepClone(Object)
      • PropertyTypeExists(String)
      • RemoveContentType(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX