Removes CannotSuppressNotificationAttribute

This commit is contained in:
Shannon
2021-07-14 11:56:30 -06:00
parent 3e586991df
commit 2fc0fc6850
6 changed files with 3 additions and 19 deletions

View File

@@ -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<CannotSuppressNotificationAttribute>() == null;
private class Suppressor : IDisposable
{
private bool _disposedValue;

View File

@@ -1,9 +0,0 @@
using System;
namespace Umbraco.Cms.Core.Notifications
{
[AttributeUsage(AttributeTargets.Class)]
internal sealed class CannotSuppressNotificationAttribute : Attribute
{
}
}

View File

@@ -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<IContent>
{

View File

@@ -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<IMedia>

View File

@@ -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<IMember>

View File

@@ -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<IContentBase>