Class MediaSavingNotification
Notification that is published before media is saved.
Inheritance
object
Namespace: Umbraco.Cms.Core.Notifications
Assembly: Umbraco.Core.dll
Syntax
public sealed class MediaSavingNotification : SavingNotification<IMedia>, IStatefulNotification, ICancelableNotification, INotification
Remarks
This notification is cancelable, allowing handlers to prevent the save operation. The notification is published by the IMediaService before media is persisted.
Constructors
View SourceMediaSavingNotification(IEnumerable<IMedia>, EventMessages)
Initializes a new instance of the MediaSavingNotification class with multiple media items.
Declaration
public MediaSavingNotification(IEnumerable<IMedia> target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<IMedia> | target | The collection of media items being saved. |
| EventMessages | messages | The event messages collection. |
MediaSavingNotification(IMedia, EventMessages)
Initializes a new instance of the MediaSavingNotification class with a single media item.
Declaration
public MediaSavingNotification(IMedia target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| IMedia | target | The media item being saved. |
| EventMessages | messages | The event messages collection. |