Search Results for

    Show / Hide Table of Contents
    View Source

    Class PropertyCollection

    Represents a collection of property values.

    Inheritance
    object
    Collection<IProperty>
    KeyedCollection<string, IProperty>
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(IsReference = true)]
    public class PropertyCollection : KeyedCollection<string, IProperty>, IPropertyCollection, IDeepCloneable

    Constructors

    View Source

    PropertyCollection()

    Initializes a new instance of the PropertyCollection class.

    Declaration
    public PropertyCollection()
    View Source

    PropertyCollection(IEnumerable<IProperty>)

    Initializes a new instance of the PropertyCollection class.

    Declaration
    public PropertyCollection(IEnumerable<IProperty> properties)
    Parameters
    Type Name Description
    IEnumerable<IProperty> properties

    Methods

    View Source

    Add(IProperty)

    Adds or updates a property.

    Declaration
    public void Add(IProperty property)
    Parameters
    Type Name Description
    IProperty property
    View Source

    ClearCollectionChangedEvents()

    Clears all collection changed event handlers.

    Declaration
    public void ClearCollectionChangedEvents()
    View Source

    ClearItems()

    Removes all properties.

    Declaration
    protected override void ClearItems()
    View Source

    DeepClone()

    Deep clones.

    Declaration
    public object DeepClone()
    Returns
    Type Description
    object
    View Source

    EnsureCleanPropertyTypes(IEnumerable<IPropertyType>)

    Ensures that the collection does not contain properties not in the specified property types.

    Declaration
    public void EnsureCleanPropertyTypes(IEnumerable<IPropertyType> propertyTypes)
    Parameters
    Type Name Description
    IEnumerable<IPropertyType> propertyTypes
    View Source

    EnsurePropertyTypes(IEnumerable<IPropertyType>)

    Ensures that the collection contains properties for the specified property types.

    Declaration
    public void EnsurePropertyTypes(IEnumerable<IPropertyType> propertyTypes)
    Parameters
    Type Name Description
    IEnumerable<IPropertyType> propertyTypes
    View Source

    GetKeyForItem(IProperty)

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

    InsertItem(int, IProperty)

    Inserts the specified property at the specified index.

    Declaration
    protected override void InsertItem(int index, IProperty property)
    Parameters
    Type Name Description
    int index
    IProperty property
    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)

    Removes the property at the specified index.

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

    SetItem(int, IProperty)

    Replaces the property at the specified index with the specified property.

    Declaration
    protected override void SetItem(int index, IProperty property)
    Parameters
    Type Name Description
    int index
    IProperty property
    View Source

    TryGetValue(string, out IProperty)

    Tries to get a property by its alias.

    Declaration
    public bool TryGetValue(string propertyTypeAlias, out IProperty property)
    Parameters
    Type Name Description
    string propertyTypeAlias

    The alias of the property type.

    IProperty property

    When this method returns, contains the property if found; otherwise, null.

    Returns
    Type Description
    bool

    true if a property with the specified alias was found; otherwise, false.

    Events

    View Source

    CollectionChanged

    Occurs when the collection changes.

    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