Search Results for

    Show / Hide Table of Contents
    View Source

    Class PropertyTypeCollection

    Represents a collection of IPropertyType objects.

    Inheritance
    object
    Collection<IPropertyType>
    KeyedCollection<string, IPropertyType>
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract]
    public class PropertyTypeCollection : KeyedCollection<string, IPropertyType>, IDeepCloneable

    Constructors

    View Source

    PropertyTypeCollection(bool)

    Initializes a new instance of the PropertyTypeCollection class.

    Declaration
    public PropertyTypeCollection(bool supportsPublishing)
    Parameters
    Type Name Description
    bool supportsPublishing

    A value indicating whether the property types in this collection support publishing.

    View Source

    PropertyTypeCollection(bool, IEnumerable<IPropertyType>)

    Initializes a new instance of the PropertyTypeCollection class with initial property types.

    Declaration
    public PropertyTypeCollection(bool supportsPublishing, IEnumerable<IPropertyType> properties)
    Parameters
    Type Name Description
    bool supportsPublishing

    A value indicating whether the property types in this collection support publishing.

    IEnumerable<IPropertyType> properties

    The initial property types to add to the collection.

    Properties

    View Source

    IsReadOnly

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    bool
    View Source

    SupportsPublishing

    Gets a value indicating whether the property types in this collection support publishing.

    Declaration
    public bool SupportsPublishing { get; }
    Property Value
    Type Description
    bool

    Methods

    View Source

    Add(IPropertyType)

    Adds a property type to the collection.

    Declaration
    public void Add(IPropertyType item)
    Parameters
    Type Name Description
    IPropertyType item

    The property type to add.

    Remarks

    The 'new' keyword is required because we can explicitly implement System.Collections.Generic.ICollection<T>.Add(T), but since normally a concrete PropertyType type is passed in, the explicit implementation doesn't get called. This ensures it does get called.

    View Source

    ClearCollectionChangedEvents()

    Clears all CollectionChanged event handlers

    Declaration
    public void ClearCollectionChangedEvents()
    View Source

    ClearItems()

    Declaration
    protected override void ClearItems()
    View Source

    Contains(string)

    Determines whether this collection contains a Property whose alias matches the specified PropertyType.

    Declaration
    public bool Contains(string propertyAlias)
    Parameters
    Type Name Description
    string propertyAlias

    Alias of the PropertyType.

    Returns
    Type Description
    bool

    true if the collection contains the specified alias; otherwise, false.

    View Source

    DeepClone()

    Creates a deep clone of the current object.

    Declaration
    public object DeepClone()
    Returns
    Type Description
    object

    A deep clone of the current object.

    View Source

    GetKeyForItem(IPropertyType)

    Declaration
    protected override string GetKeyForItem(IPropertyType item)
    Parameters
    Type Name Description
    IPropertyType item
    Returns
    Type Description
    string
    View Source

    IndexOfKey(string)

    Gets the index of the property type with the specified alias.

    Declaration
    public int IndexOfKey(string key)
    Parameters
    Type Name Description
    string key

    The alias to search for.

    Returns
    Type Description
    int

    The zero-based index of the property type, or -1 if not found.

    View Source

    InsertItem(int, IPropertyType)

    Declaration
    protected override void InsertItem(int index, IPropertyType item)
    Parameters
    Type Name Description
    int index
    IPropertyType item
    View Source

    OnCollectionChanged(NotifyCollectionChangedEventArgs)

    Raises the CollectionChanged event.

    Declaration
    protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
    Parameters
    Type Name Description
    NotifyCollectionChangedEventArgs args

    The event arguments.

    View Source

    RemoveItem(int)

    Declaration
    protected override void RemoveItem(int index)
    Parameters
    Type Name Description
    int index
    View Source

    RemoveItem(string)

    Removes the property type with the specified alias from the collection.

    Declaration
    public bool RemoveItem(string propertyTypeAlias)
    Parameters
    Type Name Description
    string propertyTypeAlias

    The alias of the property type to remove.

    Returns
    Type Description
    bool

    true if the property type was found and removed; otherwise, false.

    View Source

    SetItem(int, IPropertyType)

    Declaration
    protected override void SetItem(int index, IPropertyType item)
    Parameters
    Type Name Description
    int index
    IPropertyType item

    Events

    View Source

    CollectionChanged

    Declaration
    public event NotifyCollectionChangedEventHandler? CollectionChanged
    Event Type
    Type Description
    NotifyCollectionChangedEventHandler
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX