using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Routing; using Umbraco.Cms.Infrastructure.Services.Notifications; using Umbraco.Extensions; namespace Umbraco.Cms.Core.Compose { public sealed class NotificationsComposer : ComponentComposer, ICoreComposer { public override void Compose(IUmbracoBuilder builder) { base.Compose(builder); builder.Services.AddUnique(); // add handlers for sending user notifications (i.e. emails) builder.Services.AddUnique(); builder .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>() .AddNotificationHandler, UserNotificationsHandler>(); // add handlers for building content relations builder .AddNotificationHandler, RelateOnCopyNotifcationHandler>() .AddNotificationHandler, RelateOnTrashNotificationHandler>() .AddNotificationHandler, RelateOnTrashNotificationHandler>() .AddNotificationHandler, RelateOnTrashNotificationHandler>() .AddNotificationHandler, RelateOnTrashNotificationHandler>(); // add notification handlers for property editors builder .AddNotificationHandler, BlockEditorPropertyHandler>() .AddNotificationHandler, BlockEditorPropertyHandler>() .AddNotificationHandler, NestedContentPropertyHandler>() .AddNotificationHandler, NestedContentPropertyHandler>() .AddNotificationHandler, FileUploadPropertyEditor>() .AddNotificationHandler, FileUploadPropertyEditor>() .AddNotificationHandler, FileUploadPropertyEditor>() .AddNotificationHandler, FileUploadPropertyEditor>() .AddNotificationHandler, ImageCropperPropertyEditor>() .AddNotificationHandler, ImageCropperPropertyEditor>() .AddNotificationHandler, ImageCropperPropertyEditor>() .AddNotificationHandler, ImageCropperPropertyEditor>(); // add notification handlers for redirect tracking builder .AddNotificationHandler, RedirectTrackingHandler>() .AddNotificationHandler, RedirectTrackingHandler>() .AddNotificationHandler, RedirectTrackingHandler>() .AddNotificationHandler, RedirectTrackingHandler>(); } } }