Class NewEventArgs<TEntity>
Represents event data for new entity creation operations.
Namespace: Umbraco.Cms.Core.Events
Assembly: Umbraco.Core.dll
Syntax
public class NewEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>
Type Parameters
| Name | Description |
|---|---|
| TEntity | The type of the entity being created. |
Constructors
View SourceNewEventArgs(TEntity, bool, string, int)
Initializes a new instance of the NewEventArgs<TEntity> class.
Declaration
public NewEventArgs(TEntity eventObject, bool canCancel, string alias, int parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| bool | canCancel | A value indicating whether the event can be cancelled. |
| string | alias | The alias of the entity. |
| int | parentId | The identifier of the parent entity. |
NewEventArgs(TEntity, bool, string, int, EventMessages)
Initializes a new instance of the NewEventArgs<TEntity> class.
Declaration
public NewEventArgs(TEntity eventObject, bool canCancel, string alias, int parentId, EventMessages eventMessages)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| bool | canCancel | A value indicating whether the event can be cancelled. |
| string | alias | The alias of the entity. |
| int | parentId | The identifier of the parent entity. |
| EventMessages | eventMessages | The event messages. |
NewEventArgs(TEntity, bool, string, TEntity?)
Initializes a new instance of the NewEventArgs<TEntity> class.
Declaration
public NewEventArgs(TEntity eventObject, bool canCancel, string alias, TEntity? parent)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| bool | canCancel | A value indicating whether the event can be cancelled. |
| string | alias | The alias of the entity. |
| TEntity | parent | The parent entity. |
NewEventArgs(TEntity, bool, string, TEntity?, EventMessages)
Initializes a new instance of the NewEventArgs<TEntity> class.
Declaration
public NewEventArgs(TEntity eventObject, bool canCancel, string alias, TEntity? parent, EventMessages eventMessages)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| bool | canCancel | A value indicating whether the event can be cancelled. |
| string | alias | The alias of the entity. |
| TEntity | parent | The parent entity. |
| EventMessages | eventMessages | The event messages. |
NewEventArgs(TEntity, string, int)
Initializes a new instance of the NewEventArgs<TEntity> class with cancellation enabled.
Declaration
public NewEventArgs(TEntity eventObject, string alias, int parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| string | alias | The alias of the entity. |
| int | parentId | The identifier of the parent entity. |
NewEventArgs(TEntity, string, int, EventMessages)
Initializes a new instance of the NewEventArgs<TEntity> class with cancellation enabled.
Declaration
public NewEventArgs(TEntity eventObject, string alias, int parentId, EventMessages eventMessages)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| string | alias | The alias of the entity. |
| int | parentId | The identifier of the parent entity. |
| EventMessages | eventMessages | The event messages. |
NewEventArgs(TEntity, string, TEntity?)
Initializes a new instance of the NewEventArgs<TEntity> class with cancellation enabled.
Declaration
public NewEventArgs(TEntity eventObject, string alias, TEntity? parent)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| string | alias | The alias of the entity. |
| TEntity | parent | The parent entity. |
NewEventArgs(TEntity, string, TEntity?, EventMessages)
Initializes a new instance of the NewEventArgs<TEntity> class with cancellation enabled.
Declaration
public NewEventArgs(TEntity eventObject, string alias, TEntity? parent, EventMessages eventMessages)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | eventObject | The entity being created. |
| string | alias | The alias of the entity. |
| TEntity | parent | The parent entity. |
| EventMessages | eventMessages | The event messages. |
Properties
View SourceAlias
Gets or Sets the Alias.
Declaration
public string Alias { get; }
Property Value
| Type | Description |
|---|---|
| string |
Entity
The entity being created
Declaration
public TEntity? Entity { get; }
Property Value
| Type | Description |
|---|---|
| TEntity |
Parent
Gets or Sets the parent IContent object.
Declaration
public TEntity? Parent { get; }
Property Value
| Type | Description |
|---|---|
| TEntity |
ParentId
Gets or Sets the Id of the parent.
Declaration
public int ParentId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceEquals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Equals(NewEventArgs<TEntity>?)
Declaration
public bool Equals(NewEventArgs<TEntity>? other)
Parameters
| Type | Name | Description |
|---|---|---|
| NewEventArgs<TEntity> | other |
Returns
| Type | Description |
|---|---|
| bool |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Operators
View Sourceoperator ==(NewEventArgs<TEntity>, NewEventArgs<TEntity>)
Determines whether two NewEventArgs<TEntity> instances are equal.
Declaration
public static bool operator ==(NewEventArgs<TEntity> left, NewEventArgs<TEntity> right)
Parameters
| Type | Name | Description |
|---|---|---|
| NewEventArgs<TEntity> | left | The first instance to compare. |
| NewEventArgs<TEntity> | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(NewEventArgs<TEntity>, NewEventArgs<TEntity>)
Determines whether two NewEventArgs<TEntity> instances are not equal.
Declaration
public static bool operator !=(NewEventArgs<TEntity> left, NewEventArgs<TEntity> right)
Parameters
| Type | Name | Description |
|---|---|---|
| NewEventArgs<TEntity> | left | The first instance to compare. |
| NewEventArgs<TEntity> | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|