Class PropertyGroupCollection
Represents a collection of PropertyGroup objects
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[Serializable]
[DataContract]
public class PropertyGroupCollection : KeyedCollection<string, PropertyGroup>, IDeepCloneable
Constructors
View SourcePropertyGroupCollection()
Initializes a new instance of the PropertyGroupCollection class.
Declaration
public PropertyGroupCollection()
PropertyGroupCollection(IEnumerable<PropertyGroup>)
Initializes a new instance of the PropertyGroupCollection class.
Declaration
public PropertyGroupCollection(IEnumerable<PropertyGroup> groups)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<PropertyGroup> | groups | The groups. |
Methods
View SourceAdd(PropertyGroup)
Declaration
public void Add(PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyGroup | item |
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(int)
Declaration
public bool Contains(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id |
Returns
| Type | Description |
|---|---|
| bool |
DeepClone()
Declaration
public object DeepClone()
Returns
| Type | Description |
|---|---|
| object |
GetKeyForItem(PropertyGroup)
When implemented in a derived class, extracts the key from the specified element.
Declaration
protected override string GetKeyForItem(PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyGroup | item | The element from which to extract the key. |
Returns
| Type | Description |
|---|---|
| string | The key for the specified element. |
IndexOfKey(int)
Declaration
public int IndexOfKey(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id |
Returns
| Type | Description |
|---|---|
| int |
IndexOfKey(string)
Declaration
public int IndexOfKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| int |
InsertItem(int, PropertyGroup)
Inserts an element into the System.Collections.ObjectModel.KeyedCollection<TKey, TItem> at the specified index.
Declaration
protected override void InsertItem(int index, PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index at which |
| PropertyGroup | 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. |
SetItem(int, PropertyGroup)
Replaces the item at the specified index with the specified item.
Declaration
protected override void SetItem(int index, PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the item to be replaced. |
| PropertyGroup | item | The new item. |
Events
View SourceCollectionChanged
Occurs when the collection changes.
Declaration
public event NotifyCollectionChangedEventHandler? CollectionChanged
Event Type
| Type | Description |
|---|---|
| NotifyCollectionChangedEventHandler |