Class PropertyGroupCollection
Represents a collection of PropertyGroup objects
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[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)
Adds a property group to the collection.
Declaration
public void Add(PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyGroup | item | The property group to add. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when the property group does not have an alias set. |
| ArgumentException | Thrown when changing the alias would result in duplicates. |
ClearCollectionChangedEvents()
Clears all CollectionChanged event handlers
Declaration
public void ClearCollectionChangedEvents()
ClearItems()
Declaration
protected override void ClearItems()
Contains(int)
Determines whether the collection contains a property group with the specified identifier.
Declaration
public bool Contains(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The identifier to search for. |
Returns
| Type | Description |
|---|---|
| bool |
|
DeepClone()
Creates a deep clone of the current object.
Declaration
public object DeepClone()
Returns
| Type | Description |
|---|---|
| object | A deep clone of the current object. |
GetKeyForItem(PropertyGroup)
Declaration
protected override string GetKeyForItem(PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyGroup | item |
Returns
| Type | Description |
|---|---|
| string |
IndexOfKey(int)
Gets the index of the property group with the specified identifier.
Declaration
public int IndexOfKey(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The identifier to search for. |
Returns
| Type | Description |
|---|---|
| int | The zero-based index of the property group, or -1 if not found. |
IndexOfKey(string)
Gets the index of the property group 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 group, or -1 if not found. |
InsertItem(int, PropertyGroup)
Declaration
protected override void InsertItem(int index, PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | |
| PropertyGroup | item |
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Raises the CollectionChanged event.
Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| NotifyCollectionChangedEventArgs | args | The event arguments. |
RemoveItem(int)
Declaration
protected override void RemoveItem(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
SetItem(int, PropertyGroup)
Declaration
protected override void SetItem(int index, PropertyGroup item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | |
| PropertyGroup | item |
Events
View SourceCollectionChanged
Declaration
public event NotifyCollectionChangedEventHandler? CollectionChanged
Event Type
| Type | Description |
|---|---|
| NotifyCollectionChangedEventHandler |