Class ElementUnpublishedNotification
A notification that is used to trigger the IElementService when the UnPublish method is called in the API and after data has been unpublished.
Inheritance
Namespace: Umbraco.Cms.Core.Notifications
Assembly: Umbraco.Core.dll
Syntax
public sealed class ElementUnpublishedNotification : EnumerableObjectNotification<IElement>, IStatefulNotification, INotification
Constructors
View SourceElementUnpublishedNotification(IEnumerable<IElement>, EventMessages)
Declaration
public ElementUnpublishedNotification(IEnumerable<IElement> target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IElement> | target | |
| EventMessages | messages |
ElementUnpublishedNotification(IEnumerable<IElement>, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)
Initializes a new instance of the ElementUnpublishedNotification class with multiple elements and the cultures that were unpublished.
Declaration
public ElementUnpublishedNotification(IEnumerable<IElement> target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? unpublishedCultures)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IElement> | target | The collection of elements that were unpublished. |
| EventMessages | messages | The event messages collection. |
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> | unpublishedCultures | The cultures that were unpublished, keyed by element Key. |
ElementUnpublishedNotification(IElement, EventMessages)
Declaration
public ElementUnpublishedNotification(IElement target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IElement | target | |
| EventMessages | messages |
ElementUnpublishedNotification(IElement, EventMessages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>?)
Initializes a new instance of the ElementUnpublishedNotification class with a single element and the cultures that were unpublished.
Declaration
public ElementUnpublishedNotification(IElement target, EventMessages messages, IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? unpublishedCultures)
Parameters
| Type | Name | Description |
|---|---|---|
| IElement | target | The element that was unpublished. |
| EventMessages | messages | The event messages collection. |
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> | unpublishedCultures | The cultures that were unpublished, keyed by element Key. |
Properties
View SourceUnpublishedCultures
Gets the cultures that were unpublished for each element, keyed by element Key.
Declaration
public IReadOnlyDictionary<Guid, IReadOnlyCollection<string>>? UnpublishedCultures { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<Guid, IReadOnlyCollection<string>> |
Remarks
This notification is only raised when an element is unpublished as a whole; the value therefore
reports every culture that was taken down (for invariant elements, ["*"]). Unpublishing an individual
culture of a still-published variant element does not raise this notification — it is reported on
UnpublishedCultures instead, because that operation is performed as a
publish. Populated at raise-time (change tracking on the entity is reset once persisted, so it cannot be
recovered from UnpublishedEntities afterwards). The dictionary is null only when the
notification was raised without culture information (for example via a constructor overload that does not
accept it).
UnpublishedEntities
Gets a enumeration of IElement which are being unpublished.
Declaration
public IEnumerable<IElement> UnpublishedEntities { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IElement> |