Interface IPropertyCollection
Represents a collection of properties.
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public interface IPropertyCollection : IDeepCloneable
Properties
View SourceCount
Gets the number of properties in the collection.
Declaration
int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[int]
Gets the property at the specified index.
Declaration
IProperty? this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| IProperty |
this[string]
Gets the property with the specified alias.
Declaration
IProperty? this[string name] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Property Value
| Type | Description |
|---|---|
| IProperty |
Methods
View SourceAdd(IProperty)
Adds or updates a property.
Declaration
void Add(IProperty property)
Parameters
| Type | Name | Description |
|---|---|---|
| IProperty | property |
ClearCollectionChangedEvents()
Clears all collection changed event handlers.
Declaration
void ClearCollectionChangedEvents()
Contains(string)
Determines whether the collection contains a property with the specified alias.
Declaration
bool Contains(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The alias of the property to locate. |
Returns
| Type | Description |
|---|---|
| bool |
|
EnsureCleanPropertyTypes(IEnumerable<IPropertyType>)
Ensures that the collection does not contain properties not in the specified property types.
Declaration
void EnsureCleanPropertyTypes(IEnumerable<IPropertyType> propertyTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IPropertyType> | propertyTypes |
EnsurePropertyTypes(IEnumerable<IPropertyType>)
Ensures that the collection contains properties for the specified property types.
Declaration
void EnsurePropertyTypes(IEnumerable<IPropertyType> propertyTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IPropertyType> | propertyTypes |
TryGetValue(string, out IProperty)
Tries to get a property by its alias.
Declaration
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 |
|