Class PropertyTypeCollection
Represents a collection of IPropertyType objects.
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[Serializable]
[DataContract]
public class PropertyTypeCollection : KeyedCollection<string, IPropertyType>, IDeepCloneable
Constructors
View SourcePropertyTypeCollection(bool)
Declaration
public PropertyTypeCollection(bool supportsPublishing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | supportsPublishing |
PropertyTypeCollection(bool, IEnumerable<IPropertyType>)
Declaration
public PropertyTypeCollection(bool supportsPublishing, IEnumerable<IPropertyType> properties)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | supportsPublishing | |
| IEnumerable<IPropertyType> | properties |
Properties
View SourceIsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if the System.Collections.Generic.ICollection<T> is read-only; otherwise, false. |
SupportsPublishing
Declaration
public bool SupportsPublishing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceAdd(IPropertyType)
Adds an item to the System.Collections.Generic.ICollection<T>.
Declaration
public void Add(IPropertyType item)
Parameters
| Type | Name | Description |
|---|---|---|
| IPropertyType | item | The object to add to the System.Collections.Generic.ICollection<T>. |
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | The System.Collections.Generic.ICollection<T> is read-only. |
ClearCollectionChangedEvents()
Clears all CollectionChanged event handlers
Declaration
public void ClearCollectionChangedEvents()
ClearItems()
Removes all elements from the System.Collections.ObjectModel.KeyedCollection<TKey, TItem>.
Declaration
protected override void ClearItems()
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 |
|
DeepClone()
Declaration
public object DeepClone()
Returns
| Type | Description |
|---|---|
| object |
GetKeyForItem(IPropertyType)
When implemented in a derived class, extracts the key from the specified element.
Declaration
protected override string GetKeyForItem(IPropertyType item)
Parameters
| Type | Name | Description |
|---|---|---|
| IPropertyType | item | The element from which to extract the key. |
Returns
| Type | Description |
|---|---|
| string | The key for the specified element. |
IndexOfKey(string)
Declaration
public int IndexOfKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| int |
InsertItem(int, IPropertyType)
Inserts an element into the System.Collections.ObjectModel.KeyedCollection<TKey, TItem> at the specified index.
Declaration
protected override void InsertItem(int index, IPropertyType item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index at which |
| IPropertyType | item | The object to insert. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
-or-
|
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| NotifyCollectionChangedEventArgs | args |
RemoveItem(int)
Removes the element at the specified index of the System.Collections.ObjectModel.KeyedCollection<TKey, TItem>.
Declaration
protected override void RemoveItem(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index of the element to remove. |
RemoveItem(string)
Declaration
public bool RemoveItem(string propertyTypeAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyTypeAlias |
Returns
| Type | Description |
|---|---|
| bool |
SetItem(int, IPropertyType)
Replaces the item at the specified index with the specified item.
Declaration
protected override void SetItem(int index, IPropertyType item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the item to be replaced. |
| IPropertyType | item | The new item. |
Events
View SourceCollectionChanged
Occurs when the collection changes.
Declaration
public event NotifyCollectionChangedEventHandler? CollectionChanged
Event Type
| Type | Description |
|---|---|
| NotifyCollectionChangedEventHandler |