From 2fc0fc685020a91b2cf710b55a810c782ace2c68 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 14 Jul 2021 11:56:30 -0600 Subject: [PATCH] Removes CannotSuppressNotificationAttribute --- src/Umbraco.Core/Events/ScopedNotificationPublisher.cs | 9 +++------ .../Notifications/CannotSuppressNotificationAttribute.cs | 9 --------- .../Notifications/ContentRefreshNotification.cs | 1 - .../Notifications/MediaRefreshNotification.cs | 1 - .../Notifications/MemberRefreshNotification.cs | 1 - .../Notifications/ScopedEntityRemoveNotification.cs | 1 - 6 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 src/Umbraco.Core/Notifications/CannotSuppressNotificationAttribute.cs diff --git a/src/Umbraco.Core/Events/ScopedNotificationPublisher.cs b/src/Umbraco.Core/Events/ScopedNotificationPublisher.cs index cf6260291b..7261b514bf 100644 --- a/src/Umbraco.Core/Events/ScopedNotificationPublisher.cs +++ b/src/Umbraco.Core/Events/ScopedNotificationPublisher.cs @@ -29,7 +29,7 @@ namespace Umbraco.Cms.Core.Events throw new ArgumentNullException(nameof(notification)); } - if (CanSuppress(notification) && _isSuppressed) + if (_isSuppressed) { return false; } @@ -45,7 +45,7 @@ namespace Umbraco.Cms.Core.Events throw new ArgumentNullException(nameof(notification)); } - if (CanSuppress(notification) && _isSuppressed) + if (_isSuppressed) { return false; } @@ -61,7 +61,7 @@ namespace Umbraco.Cms.Core.Events throw new ArgumentNullException(nameof(notification)); } - if (CanSuppress(notification) && _isSuppressed) + if (_isSuppressed) { return; } @@ -99,9 +99,6 @@ namespace Umbraco.Cms.Core.Events } } - private bool CanSuppress(INotification notification) - => notification.GetType().GetCustomAttribute() == null; - private class Suppressor : IDisposable { private bool _disposedValue; diff --git a/src/Umbraco.Core/Notifications/CannotSuppressNotificationAttribute.cs b/src/Umbraco.Core/Notifications/CannotSuppressNotificationAttribute.cs deleted file mode 100644 index 8279ae4caf..0000000000 --- a/src/Umbraco.Core/Notifications/CannotSuppressNotificationAttribute.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Umbraco.Cms.Core.Notifications -{ - [AttributeUsage(AttributeTargets.Class)] - internal sealed class CannotSuppressNotificationAttribute : Attribute - { - } -} diff --git a/src/Umbraco.Core/Notifications/ContentRefreshNotification.cs b/src/Umbraco.Core/Notifications/ContentRefreshNotification.cs index f2c81d3fac..b9cda7722c 100644 --- a/src/Umbraco.Core/Notifications/ContentRefreshNotification.cs +++ b/src/Umbraco.Core/Notifications/ContentRefreshNotification.cs @@ -7,7 +7,6 @@ namespace Umbraco.Cms.Core.Notifications { [Obsolete("This is only used for the internal cache and will change, use saved notifications instead")] - [CannotSuppressNotification] [EditorBrowsable(EditorBrowsableState.Never)] public class ContentRefreshNotification : EntityRefreshNotification { diff --git a/src/Umbraco.Core/Notifications/MediaRefreshNotification.cs b/src/Umbraco.Core/Notifications/MediaRefreshNotification.cs index 4fe0f82d33..1c8b8b9bea 100644 --- a/src/Umbraco.Core/Notifications/MediaRefreshNotification.cs +++ b/src/Umbraco.Core/Notifications/MediaRefreshNotification.cs @@ -5,7 +5,6 @@ using Umbraco.Cms.Core.Models; namespace Umbraco.Cms.Core.Notifications { - [CannotSuppressNotification] [Obsolete("This is only used for the internal cache and will change, use tree change notifications instead")] [EditorBrowsable(EditorBrowsableState.Never)] public class MediaRefreshNotification : EntityRefreshNotification diff --git a/src/Umbraco.Core/Notifications/MemberRefreshNotification.cs b/src/Umbraco.Core/Notifications/MemberRefreshNotification.cs index d4dfeef68f..a22c48348f 100644 --- a/src/Umbraco.Core/Notifications/MemberRefreshNotification.cs +++ b/src/Umbraco.Core/Notifications/MemberRefreshNotification.cs @@ -5,7 +5,6 @@ using Umbraco.Cms.Core.Models; namespace Umbraco.Cms.Core.Notifications { - [CannotSuppressNotification] [Obsolete("This is only used for the internal cache and will change, use tree change notifications instead")] [EditorBrowsable(EditorBrowsableState.Never)] public class MemberRefreshNotification : EntityRefreshNotification diff --git a/src/Umbraco.Core/Notifications/ScopedEntityRemoveNotification.cs b/src/Umbraco.Core/Notifications/ScopedEntityRemoveNotification.cs index a86ea659bb..307ae2103c 100644 --- a/src/Umbraco.Core/Notifications/ScopedEntityRemoveNotification.cs +++ b/src/Umbraco.Core/Notifications/ScopedEntityRemoveNotification.cs @@ -5,7 +5,6 @@ using Umbraco.Cms.Core.Models; namespace Umbraco.Cms.Core.Notifications { - [CannotSuppressNotification] [Obsolete("This is only used for the internal cache and will change, use tree change notifications instead")] [EditorBrowsable(EditorBrowsableState.Never)] public class ScopedEntityRemoveNotification : ObjectNotification