Class CopyEventArgs<TEntity>
Represents event data for copy operations.
Namespace: Umbraco.Cms.Core.Events
Assembly: Umbraco.Core.dll
Syntax
public class CopyEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>
Type Parameters
| Name | Description |
|---|---|
| TEntity | The type of the entity being copied. |
Constructors
View SourceCopyEventArgs(TEntity, TEntity, bool, int)
Initializes a new instance of the CopyEventArgs<TEntity> class.
Declaration
public CopyEventArgs(TEntity original, TEntity copy, bool canCancel, int parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | original | The original entity being copied. |
| TEntity | copy | The copied entity. |
| bool | canCancel | A value indicating whether the event can be cancelled. |
| int | parentId | The identifier of the new parent. |
CopyEventArgs(TEntity, TEntity, bool, int, bool)
Initializes a new instance of the CopyEventArgs<TEntity> class.
Declaration
public CopyEventArgs(TEntity eventObject, TEntity copy, bool canCancel, int parentId, bool relateToOriginal)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The original entity being copied. |
| TEntity | copy | The copied entity. |
| bool | canCancel | A value indicating whether the event can be cancelled. |
| int | parentId | The identifier of the new parent. |
| bool | relateToOriginal | A value indicating whether to create a relation to the original entity. |
CopyEventArgs(TEntity, TEntity, int)
Initializes a new instance of the CopyEventArgs<TEntity> class with cancellation enabled.
Declaration
public CopyEventArgs(TEntity eventObject, TEntity copy, int parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The original entity being copied. |
| TEntity | copy | The copied entity. |
| int | parentId | The identifier of the new parent. |
Properties
View SourceCopy
The copied entity
Declaration
public TEntity Copy { get; set; }
Property Value
| Type | Description |
|---|---|
| TEntity |
Original
The original entity
Declaration
public TEntity? Original { get; }
Property Value
| Type | Description |
|---|---|
| TEntity |
ParentId
Gets or Sets the Id of the objects new parent.
Declaration
public int ParentId { get; }
Property Value
| Type | Description |
|---|---|
| int |
RelateToOriginal
Gets or sets a value indicating whether to create a relation to the original entity.
Declaration
public bool RelateToOriginal { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceEquals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Equals(CopyEventArgs<TEntity>?)
Declaration
public bool Equals(CopyEventArgs<TEntity>? other)
Parameters
| Type | Name | Description |
|---|---|---|
| CopyEventArgs<TEntity> | other |
Returns
| Type | Description |
|---|---|
| bool |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Operators
View Sourceoperator ==(CopyEventArgs<TEntity>, CopyEventArgs<TEntity>)
Determines whether two CopyEventArgs<TEntity> instances are equal.
Declaration
public static bool operator ==(CopyEventArgs<TEntity> left, CopyEventArgs<TEntity> right)
Parameters
| Type | Name | Description |
|---|---|---|
| CopyEventArgs<TEntity> | left | The first instance to compare. |
| CopyEventArgs<TEntity> | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(CopyEventArgs<TEntity>, CopyEventArgs<TEntity>)
Determines whether two CopyEventArgs<TEntity> instances are not equal.
Declaration
public static bool operator !=(CopyEventArgs<TEntity> left, CopyEventArgs<TEntity> right)
Parameters
| Type | Name | Description |
|---|---|---|
| CopyEventArgs<TEntity> | left | The first instance to compare. |
| CopyEventArgs<TEntity> | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|