Class DeepCloneableList<T>
A List that can be deep cloned with deep cloned elements and can reset the collection's items dirty flags
Inheritance
Namespace: Umbraco.Cms.Core.Collections
Assembly: Umbraco.Core.dll
Syntax
public class DeepCloneableList<T> : List<T>, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
View SourceDeepCloneableList(IEnumerable<T>)
Default behavior is CloneOnce
Declaration
public DeepCloneableList(IEnumerable<T> collection)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | collection |
DeepCloneableList(IEnumerable<T>, ListCloneBehavior)
Declaration
public DeepCloneableList(IEnumerable<T> collection, ListCloneBehavior listCloneBehavior)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | collection | |
| ListCloneBehavior | listCloneBehavior |
DeepCloneableList(ListCloneBehavior)
Declaration
public DeepCloneableList(ListCloneBehavior listCloneBehavior)
Parameters
| Type | Name | Description |
|---|---|---|
| ListCloneBehavior | listCloneBehavior |
Methods
View SourceDeepClone()
Creates a new list and adds each element as a deep cloned element if it is of type IDeepCloneable
Declaration
public object DeepClone()
Returns
| Type | Description |
|---|---|
| object |
DisableChangeTracking()
Disables change tracking.
Declaration
public void DisableChangeTracking()
EnableChangeTracking()
Enables change tracking.
Declaration
public void EnableChangeTracking()
GetDirtyProperties()
Gets properties that are dirty.
Declaration
public IEnumerable<string> GetDirtyProperties()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> |
Remarks
Always return an empty enumerable, the list has no properties that can be dirty.
GetWereDirtyProperties()
Declaration
public IEnumerable<string> GetWereDirtyProperties()
Returns
| Type | Description |
|---|---|
| IEnumerable<string> |
Remarks
Always return an empty enumerable, the list has no properties that can be dirty.
IsDirty()
Determines whether the current entity is dirty.
Declaration
public bool IsDirty()
Returns
| Type | Description |
|---|---|
| bool |
IsPropertyDirty(string)
Determines whether a specific property is dirty.
Declaration
public bool IsPropertyDirty(string propName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propName |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
Always return false, the list has no properties that can be dirty.
ResetDirtyProperties()
Resets dirty properties.
Declaration
public void ResetDirtyProperties()
ResetDirtyProperties(bool)
Resets dirty properties.
Declaration
public void ResetDirtyProperties(bool rememberDirty)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | rememberDirty | A value indicating whether to remember dirty properties. |
Remarks
When rememberDirty is true, dirty properties are saved so they can be checked with
WasDirty.
ResetWereDirtyProperties()
Resets properties that were dirty.
Declaration
public void ResetWereDirtyProperties()
WasDirty()
Determines whether the current entity is dirty.
Declaration
public bool WasDirty()
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A property was dirty if it had been changed and the changes were committed.
WasPropertyDirty(string)
Determines whether a specific property was dirty.
Declaration
public bool WasPropertyDirty(string propertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A property was dirty if it had been changed and the changes were committed.
Events
View SourcePropertyChanged
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
| Type | Description |
|---|---|
| PropertyChangedEventHandler |