Make internal & private classes sealed where possible, to avoid code for virtual dispatch (#19719)
This commit is contained in:
@@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Configuration.Models;
|
||||
|
||||
namespace Umbraco.Cms.Api.Common.Configuration;
|
||||
|
||||
internal class ConfigureOpenIddict : IConfigureOptions<OpenIddictServerAspNetCoreOptions>
|
||||
internal sealed class ConfigureOpenIddict : IConfigureOptions<OpenIddictServerAspNetCoreOptions>
|
||||
{
|
||||
private readonly IOptions<GlobalSettings> _globalSettings;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Umbraco.Cms.Api.Common.Json;
|
||||
|
||||
internal class NamedSystemTextJsonInputFormatter : SystemTextJsonInputFormatter
|
||||
internal sealed class NamedSystemTextJsonInputFormatter : SystemTextJsonInputFormatter
|
||||
{
|
||||
private readonly string _jsonOptionsName;
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
|
||||
namespace Umbraco.Cms.Api.Common.Json;
|
||||
|
||||
|
||||
internal class NamedSystemTextJsonOutputFormatter : SystemTextJsonOutputFormatter
|
||||
internal sealed class NamedSystemTextJsonOutputFormatter : SystemTextJsonOutputFormatter
|
||||
{
|
||||
private readonly string _jsonOptionsName;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions :
|
||||
options.OperationFilter<DeliveryApiSecurityFilter>();
|
||||
}
|
||||
|
||||
private class DeliveryApiSecurityFilter : SwaggerFilterBase<ContentApiControllerBase>, IOperationFilter, IDocumentFilter
|
||||
private sealed class DeliveryApiSecurityFilter : SwaggerFilterBase<ContentApiControllerBase>, IOperationFilter, IDocumentFilter
|
||||
{
|
||||
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ internal sealed class ContextualizeFromAcceptHeadersAttribute : TypeFilterAttrib
|
||||
{
|
||||
}
|
||||
|
||||
private class LocalizeFromAcceptLanguageHeaderAttributeFilter : IActionFilter
|
||||
private sealed class LocalizeFromAcceptLanguageHeaderAttributeFilter : IActionFilter
|
||||
{
|
||||
private readonly IRequestCultureService _requestCultureService;
|
||||
private readonly IRequestSegmmentService _requestSegmentService;
|
||||
|
||||
@@ -11,7 +11,7 @@ internal sealed class DeliveryApiAccessAttribute : TypeFilterAttribute
|
||||
{
|
||||
}
|
||||
|
||||
private class DeliveryApiAccessFilter : IActionFilter
|
||||
private sealed class DeliveryApiAccessFilter : IActionFilter
|
||||
{
|
||||
private readonly IApiAccessService _apiAccessService;
|
||||
private readonly IRequestPreviewService _requestPreviewService;
|
||||
|
||||
@@ -11,7 +11,7 @@ internal sealed class DeliveryApiMediaAccessAttribute : TypeFilterAttribute
|
||||
{
|
||||
}
|
||||
|
||||
private class DeliveryApiMediaAccessFilter : IActionFilter
|
||||
private sealed class DeliveryApiMediaAccessFilter : IActionFilter
|
||||
{
|
||||
private readonly IApiAccessService _apiAccessService;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ internal sealed class ValidateStartItemAttribute : TypeFilterAttribute
|
||||
{
|
||||
}
|
||||
|
||||
private class ValidateStartItemFilter : IActionFilter
|
||||
private sealed class ValidateStartItemFilter : IActionFilter
|
||||
{
|
||||
private readonly IRequestStartItemProviderAccessor _requestStartItemProviderAccessor;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ internal sealed class RequestContextOutputExpansionStrategyV2 : IOutputExpansion
|
||||
private object? GetPropertyValue(IPublishedProperty property)
|
||||
=> _propertyRenderer.GetPropertyValue(property, _expandProperties.Peek() is not null);
|
||||
|
||||
private class Node
|
||||
private sealed class Node
|
||||
{
|
||||
public string Key { get; private set; } = string.Empty;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public static class BackOfficeAuthBuilderExtensions
|
||||
}
|
||||
}
|
||||
|
||||
internal class BackofficePipelineFilter : UmbracoPipelineFilter
|
||||
internal sealed class BackofficePipelineFilter : UmbracoPipelineFilter
|
||||
{
|
||||
public BackofficePipelineFilter(string name)
|
||||
: base(name)
|
||||
|
||||
@@ -13,7 +13,7 @@ using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.Factories;
|
||||
|
||||
internal class PackagePresentationFactory : IPackagePresentationFactory
|
||||
internal sealed class PackagePresentationFactory : IPackagePresentationFactory
|
||||
{
|
||||
private readonly IUmbracoMapper _umbracoMapper;
|
||||
private readonly IRuntimeState _runtimeState;
|
||||
|
||||
@@ -8,7 +8,7 @@ using Umbraco.Cms.Core.Webhooks;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.Factories;
|
||||
|
||||
internal class WebhookPresentationFactory : IWebhookPresentationFactory
|
||||
internal sealed class WebhookPresentationFactory : IWebhookPresentationFactory
|
||||
{
|
||||
private readonly WebhookEventCollection _webhookEventCollection;
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
|
||||
@@ -21,7 +21,7 @@ public sealed class AppendEventMessagesAttribute : TypeFilterAttribute
|
||||
{
|
||||
}
|
||||
|
||||
private class AppendEventMessagesFilter : IActionFilter
|
||||
private sealed class AppendEventMessagesFilter : IActionFilter
|
||||
{
|
||||
private readonly IEventMessagesFactory _eventMessagesFactory;
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
|
||||
@@ -4,14 +4,14 @@ using Umbraco.Cms.Core.Configuration.Models;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.Filters;
|
||||
|
||||
internal class UserPasswordEnsureMinimumResponseTimeAttribute : TypeFilterAttribute
|
||||
internal sealed class UserPasswordEnsureMinimumResponseTimeAttribute : TypeFilterAttribute
|
||||
{
|
||||
public UserPasswordEnsureMinimumResponseTimeAttribute()
|
||||
: base(typeof(UserPasswordEnsureMinimumResponseTimeFilter))
|
||||
{
|
||||
}
|
||||
|
||||
private class UserPasswordEnsureMinimumResponseTimeFilter : EnsureMinimumResponseTimeFilter
|
||||
private sealed class UserPasswordEnsureMinimumResponseTimeFilter : EnsureMinimumResponseTimeFilter
|
||||
{
|
||||
public UserPasswordEnsureMinimumResponseTimeFilter(IOptions<UserPasswordConfigurationSettings> options)
|
||||
: base(options.Value.MinimumResponseTime)
|
||||
|
||||
@@ -45,7 +45,7 @@ public static class SectionMapper
|
||||
return name;
|
||||
}
|
||||
|
||||
private class SectionMapping
|
||||
private sealed class SectionMapping
|
||||
{
|
||||
public required string Alias { get; init; }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using Umbraco.Cms.Api.Management.DependencyInjection;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.OpenApi;
|
||||
|
||||
internal class BackOfficeSecurityRequirementsOperationFilter : BackOfficeSecurityRequirementsOperationFilterBase
|
||||
internal sealed class BackOfficeSecurityRequirementsOperationFilter : BackOfficeSecurityRequirementsOperationFilterBase
|
||||
{
|
||||
protected override string ApiName => ManagementApiConfiguration.ApiName;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using Umbraco.Cms.Core;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.OpenApi;
|
||||
|
||||
internal class NotificationHeaderFilter : IOperationFilter
|
||||
internal sealed class NotificationHeaderFilter : IOperationFilter
|
||||
{
|
||||
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Api.Management.OpenApi;
|
||||
|
||||
internal class ResponseHeaderOperationFilter : IOperationFilter
|
||||
internal sealed class ResponseHeaderOperationFilter : IOperationFilter
|
||||
{
|
||||
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||
{
|
||||
@@ -29,7 +29,7 @@ internal class ResponseHeaderOperationFilter : IOperationFilter
|
||||
}
|
||||
}
|
||||
|
||||
private void SetHeader(OpenApiResponse value, string headerName, string description, string type, string? format = null)
|
||||
private static void SetHeader(OpenApiResponse value, string headerName, string description, string type, string? format = null)
|
||||
{
|
||||
|
||||
if (value.Headers is null)
|
||||
|
||||
@@ -61,7 +61,7 @@ public class BackOfficeAuthenticationBuilder : AuthenticationBuilder
|
||||
// TODO: We could override and throw NotImplementedException for other methods?
|
||||
|
||||
// Ensures that the sign in scheme is always the Umbraco back office external type
|
||||
internal class EnsureBackOfficeScheme<TOptions> : IPostConfigureOptions<TOptions>
|
||||
internal sealed class EnsureBackOfficeScheme<TOptions> : IPostConfigureOptions<TOptions>
|
||||
where TOptions : RemoteAuthenticationOptions
|
||||
{
|
||||
public void PostConfigure(string? name, TOptions options)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Api.Management.Security;
|
||||
/// <summary>
|
||||
/// Custom secure format that ensures the Identity in the ticket is verified <see cref="ClaimsIdentity" />
|
||||
/// </summary>
|
||||
internal class BackOfficeSecureDataFormat : ISecureDataFormat<AuthenticationTicket>
|
||||
internal sealed class BackOfficeSecureDataFormat : ISecureDataFormat<AuthenticationTicket>
|
||||
{
|
||||
private readonly TimeSpan _loginTimeout;
|
||||
private readonly ISecureDataFormat<AuthenticationTicket> _ticketDataFormat;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Cache.PartialViewCacheInvalidators;
|
||||
/// The default implementation is added in Umbraco.Web.Website, but we need this to ensure we have a service
|
||||
/// registered for this interface even in headless setups).
|
||||
/// </remarks>
|
||||
internal class NoopMemberPartialViewCacheInvalidator : IMemberPartialViewCacheInvalidator
|
||||
internal sealed class NoopMemberPartialViewCacheInvalidator : IMemberPartialViewCacheInvalidator
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void ClearPartialViewCacheItems(IEnumerable<int> memberIds)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Core.Composing;
|
||||
/// <summary>
|
||||
/// Handles the composers.
|
||||
/// </summary>
|
||||
internal class ComposerGraph
|
||||
internal sealed class ComposerGraph
|
||||
{
|
||||
private readonly IUmbracoBuilder _builder;
|
||||
private readonly IEnumerable<Type> _composerTypes;
|
||||
@@ -415,7 +415,7 @@ internal class ComposerGraph
|
||||
}
|
||||
}
|
||||
|
||||
private class EnableInfo
|
||||
private sealed class EnableInfo
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Cms.Core.Composing;
|
||||
/// borrowed and modified from here
|
||||
/// https://github.com/dotnet/aspnetcore-tooling/blob/master/src/Razor/src/Microsoft.NET.Sdk.Razor/FindAssembliesWithReferencesTo.cs
|
||||
/// </remarkes>
|
||||
internal class FindAssembliesWithReferencesTo
|
||||
internal sealed class FindAssembliesWithReferencesTo
|
||||
{
|
||||
private readonly bool _includeTargets;
|
||||
private readonly ILogger<FindAssembliesWithReferencesTo> _logger;
|
||||
|
||||
@@ -408,7 +408,7 @@ public sealed class TypeLoader
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Exception" />
|
||||
[Serializable]
|
||||
internal class CachedTypeNotFoundInFileException : Exception
|
||||
internal sealed class CachedTypeNotFoundInFileException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CachedTypeNotFoundInFileException" /> class.
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Reflection;
|
||||
|
||||
namespace Umbraco.Cms.Core.Configuration;
|
||||
|
||||
internal class EntryAssemblyMetadata : IEntryAssemblyMetadata
|
||||
internal sealed class EntryAssemblyMetadata : IEntryAssemblyMetadata
|
||||
{
|
||||
public EntryAssemblyMetadata()
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ContentErrorPage : ValidatableEntryBase
|
||||
[Required]
|
||||
public string Culture { get; set; } = null!;
|
||||
|
||||
internal override bool IsValid() =>
|
||||
internal sealed override bool IsValid() =>
|
||||
base.IsValid() &&
|
||||
(HasContentId ^ HasContentKey);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Cms.Core.Diagnostics;
|
||||
|
||||
internal class NoopMarchal : IMarchal
|
||||
internal sealed class NoopMarchal : IMarchal
|
||||
{
|
||||
public IntPtr GetExceptionPointers() => IntPtr.Zero;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Umbraco.Cms.Core.Dictionary;
|
||||
/// fast
|
||||
/// (even though there is caching involved, if there's lots of dictionary items the caching is not great)
|
||||
/// </remarks>
|
||||
internal class DefaultCultureDictionary : ICultureDictionary
|
||||
internal sealed class DefaultCultureDictionary : ICultureDictionary
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly IAppCache _requestCache;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core;
|
||||
/// <summary>
|
||||
/// Currently just used to get the machine name for use with file names
|
||||
/// </summary>
|
||||
internal class EnvironmentHelper
|
||||
internal static class EnvironmentHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the machine name that is safe to use in file paths.
|
||||
|
||||
@@ -102,7 +102,7 @@ public partial class EventAggregator : IEventAggregator
|
||||
}
|
||||
}
|
||||
|
||||
private void PublishCore<TNotification>(IEnumerable<Action<IEnumerable<TNotification>>> allHandlers, IEnumerable<TNotification> notifications)
|
||||
private static void PublishCore<TNotification>(IEnumerable<Action<IEnumerable<TNotification>>> allHandlers, IEnumerable<TNotification> notifications)
|
||||
{
|
||||
foreach (Action<IEnumerable<TNotification>> handler in allHandlers)
|
||||
{
|
||||
@@ -110,7 +110,7 @@ public partial class EventAggregator : IEventAggregator
|
||||
}
|
||||
}
|
||||
|
||||
private async Task PublishCoreAsync<TNotification>(IEnumerable<Func<IEnumerable<TNotification>, CancellationToken, Task>> allHandlers, IEnumerable<TNotification> notifications, CancellationToken cancellationToken)
|
||||
private static async Task PublishCoreAsync<TNotification>(IEnumerable<Func<IEnumerable<TNotification>, CancellationToken, Task>> allHandlers, IEnumerable<TNotification> notifications, CancellationToken cancellationToken)
|
||||
{
|
||||
foreach (Func<IEnumerable<TNotification>, CancellationToken, Task> handler in allHandlers)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ internal abstract class NotificationAsyncHandlerWrapper
|
||||
where TNotificationHandler : INotificationHandler;
|
||||
}
|
||||
|
||||
internal class NotificationAsyncHandlerWrapperImpl<TNotificationType> : NotificationAsyncHandlerWrapper
|
||||
internal sealed class NotificationAsyncHandlerWrapperImpl<TNotificationType> : NotificationAsyncHandlerWrapper
|
||||
where TNotificationType : INotification
|
||||
{
|
||||
/// <remarks>
|
||||
@@ -260,7 +260,7 @@ internal class NotificationAsyncHandlerWrapperImpl<TNotificationType> : Notifica
|
||||
}
|
||||
}
|
||||
|
||||
internal class NotificationHandlerWrapperImpl<TNotificationType> : NotificationHandlerWrapper
|
||||
internal sealed class NotificationHandlerWrapperImpl<TNotificationType> : NotificationHandlerWrapper
|
||||
where TNotificationType : INotification
|
||||
{
|
||||
/// <remarks>
|
||||
|
||||
@@ -169,7 +169,7 @@ public class EventNameExtractor
|
||||
return words[0].EndsWith("ing") == false;
|
||||
}
|
||||
|
||||
private class EventInfoArgs
|
||||
private sealed class EventInfoArgs
|
||||
{
|
||||
public EventInfoArgs(EventInfo eventInfo, Type[] genericArgs)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Events;
|
||||
/// This means that events will be raised during the scope transaction,
|
||||
/// whatever happens, and the transaction could roll back in the end.
|
||||
/// </remarks>
|
||||
internal class PassThroughEventDispatcher : IEventDispatcher
|
||||
internal sealed class PassThroughEventDispatcher : IEventDispatcher
|
||||
{
|
||||
public bool DispatchCancelable(EventHandler? eventHandler, object sender, CancellableEventArgs args, string? eventName = null)
|
||||
{
|
||||
|
||||
@@ -414,7 +414,7 @@ public abstract class QueuingEventDispatcherBase : IEventDispatcher
|
||||
}
|
||||
}
|
||||
|
||||
private class EventDefinitionInfos
|
||||
private sealed class EventDefinitionInfos
|
||||
{
|
||||
public IEventDefinition? EventDefinition { get; set; }
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ScopedNotificationPublisher<TNotificationHandler> : IScopedNotifica
|
||||
protected virtual void PublishScopedNotifications(IList<INotification> notifications)
|
||||
=> _eventAggregator.Publish<INotification, TNotificationHandler>(notifications);
|
||||
|
||||
private class Suppressor : IDisposable
|
||||
private sealed class Suppressor : IDisposable
|
||||
{
|
||||
private readonly ScopedNotificationPublisher<TNotificationHandler> _scopedNotificationPublisher;
|
||||
private bool _disposedValue;
|
||||
@@ -129,7 +129,7 @@ public class ScopedNotificationPublisher<TNotificationHandler> : IScopedNotifica
|
||||
|
||||
public void Dispose() => Dispose(true);
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
{
|
||||
|
||||
@@ -96,7 +96,7 @@ public class WarnDocumentTypeElementSwitchNotificationHandler :
|
||||
}
|
||||
}
|
||||
|
||||
private class DocumentTypeElementSwitchInformation
|
||||
private sealed class DocumentTypeElementSwitchInformation
|
||||
{
|
||||
public bool WasElement { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Cms.Core.Hosting;
|
||||
|
||||
internal class NoopApplicationShutdownRegistry : IApplicationShutdownRegistry
|
||||
internal sealed class NoopApplicationShutdownRegistry : IApplicationShutdownRegistry
|
||||
{
|
||||
public void RegisterObject(IRegisteredObject registeredObject)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace Umbraco.Cms.Core.IO;
|
||||
|
||||
internal class ShadowFileSystem : IFileSystem
|
||||
internal sealed class ShadowFileSystem : IFileSystem
|
||||
{
|
||||
private readonly IFileSystem _sfs;
|
||||
|
||||
@@ -392,7 +392,7 @@ internal class ShadowFileSystem : IFileSystem
|
||||
}
|
||||
|
||||
// copied from System.Web.Util.Wildcard internal
|
||||
internal class WildcardExpression
|
||||
internal sealed class WildcardExpression
|
||||
{
|
||||
private static readonly Regex MetaRegex = new("[\\+\\{\\\\\\[\\|\\(\\)\\.\\^\\$]");
|
||||
private static readonly Regex QuestRegex = new("\\?");
|
||||
@@ -454,7 +454,7 @@ internal class ShadowFileSystem : IFileSystem
|
||||
}
|
||||
}
|
||||
|
||||
private class ShadowNode
|
||||
private sealed class ShadowNode
|
||||
{
|
||||
public ShadowNode(bool isDelete, bool isdir)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Cms.Core.IO;
|
||||
|
||||
// shadow filesystems is definitively ... too convoluted
|
||||
internal class ShadowFileSystems : ICompletable
|
||||
internal sealed class ShadowFileSystems : ICompletable
|
||||
{
|
||||
private readonly FileSystems _fileSystems;
|
||||
private bool _completed;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Core.IO;
|
||||
|
||||
internal class ShadowWrapper : IFileSystem, IFileProviderFactory
|
||||
internal sealed class ShadowWrapper : IFileSystem, IFileProviderFactory
|
||||
{
|
||||
private const string ShadowFsPath = "ShadowFs";
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class LogProfiler : IProfiler
|
||||
public bool IsEnabled => _logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug);
|
||||
|
||||
// a lightweight disposable timer
|
||||
private class LightDisposableTimer : DisposableObjectSlim
|
||||
private sealed class LightDisposableTimer : DisposableObjectSlim
|
||||
{
|
||||
private readonly Action<long> _callback;
|
||||
private readonly Stopwatch _stopwatch = Stopwatch.StartNew();
|
||||
|
||||
@@ -17,7 +17,7 @@ public class NoopProfiler : IProfiler
|
||||
/// <inheritdoc/>
|
||||
public bool IsEnabled => false;
|
||||
|
||||
private class VoidDisposable : DisposableObjectSlim
|
||||
private sealed class VoidDisposable : DisposableObjectSlim
|
||||
{
|
||||
protected override void DisposeResources()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using Umbraco.Cms.Core.Models.Email;
|
||||
|
||||
namespace Umbraco.Cms.Core.Mail;
|
||||
|
||||
internal class NotImplementedEmailSender : IEmailSender
|
||||
internal sealed class NotImplementedEmailSender : IEmailSender
|
||||
{
|
||||
public Task SendAsync(EmailMessage message, string emailType)
|
||||
=> throw new NotImplementedException(
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Umbraco.Cms.Core.Mail;
|
||||
/// <summary>
|
||||
/// An <see cref="ISmsSender" /> that throws <see cref="NotImplementedException" />
|
||||
/// </summary>
|
||||
internal class NotImplementedSmsSender : ISmsSender
|
||||
internal sealed class NotImplementedSmsSender : ISmsSender
|
||||
{
|
||||
public Task SendSmsAsync(string number, string message)
|
||||
=> throw new NotImplementedException(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Cms.Core.Models;
|
||||
|
||||
internal class DefaultPayloadModel
|
||||
internal sealed class DefaultPayloadModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ public class User : EntityBase, IUser, IProfile
|
||||
/// <summary>
|
||||
/// Internal class used to wrap the user in a profile
|
||||
/// </summary>
|
||||
private class WrappedUserProfile : IProfile
|
||||
private sealed class WrappedUserProfile : IProfile
|
||||
{
|
||||
private readonly IUser _user;
|
||||
|
||||
|
||||
@@ -373,7 +373,7 @@ public class ModelType : Type
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
internal class ModelTypeArrayType : Type
|
||||
internal sealed class ModelTypeArrayType : Type
|
||||
{
|
||||
private readonly Type _elementType;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.PublishedContent;
|
||||
|
||||
internal class PublishedContentTypeConverter : TypeConverter
|
||||
internal sealed class PublishedContentTypeConverter : TypeConverter
|
||||
{
|
||||
private static readonly Type[] ConvertingTypes = { typeof(int) };
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ public class PublishedModelFactory : IPublishedModelFactory
|
||||
public Type MapModelType(Type type)
|
||||
=> ModelType.Map(type, _modelTypeMap);
|
||||
|
||||
private class ModelInfo
|
||||
private sealed class ModelInfo
|
||||
{
|
||||
public Type? ParameterType { get; set; }
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class UpgradeCheckRepository : IUpgradeCheckRepository
|
||||
}
|
||||
}
|
||||
|
||||
private class CheckUpgradeDto
|
||||
private sealed class CheckUpgradeDto
|
||||
{
|
||||
public CheckUpgradeDto(SemVersion version)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Umbraco.Cms.Core.IO;
|
||||
|
||||
namespace Umbraco.Cms.Core.PropertyEditors;
|
||||
|
||||
internal class ContentPickerConfigurationEditor : ConfigurationEditor<ContentPickerConfiguration>
|
||||
internal sealed class ContentPickerConfigurationEditor : ConfigurationEditor<ContentPickerConfiguration>
|
||||
{
|
||||
public ContentPickerConfigurationEditor(IIOHelper ioHelper)
|
||||
: base(ioHelper)
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ContentPickerPropertyEditor : DataEditor
|
||||
protected override IDataValueEditor CreateValueEditor() =>
|
||||
DataValueEditorFactory.Create<ContentPickerPropertyValueEditor>(Attribute!);
|
||||
|
||||
internal class ContentPickerPropertyValueEditor : DataValueEditor, IDataValueReference
|
||||
internal sealed class ContentPickerPropertyValueEditor : DataValueEditor, IDataValueReference
|
||||
{
|
||||
|
||||
public ContentPickerPropertyValueEditor(
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Umbraco.Cms.Core.PropertyEditors;
|
||||
/// CUstom value editor so we can serialize with the correct date format (excluding time)
|
||||
/// and includes the date validator
|
||||
/// </summary>
|
||||
internal class DateValueEditor : DataValueEditor
|
||||
internal sealed class DateValueEditor : DataValueEditor
|
||||
{
|
||||
public DateValueEditor(
|
||||
IShortStringHelper shortStringHelper,
|
||||
|
||||
@@ -41,7 +41,7 @@ public class DecimalPropertyEditor : DataEditor
|
||||
/// <summary>
|
||||
/// Defines the value editor for the decimal property editor.
|
||||
/// </summary>
|
||||
internal class DecimalPropertyValueEditor : DataValueEditor
|
||||
internal sealed class DecimalPropertyValueEditor : DataValueEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DecimalPropertyValueEditor"/> class.
|
||||
@@ -63,7 +63,7 @@ public class DecimalPropertyEditor : DataEditor
|
||||
public override object? FromEditor(ContentPropertyData editorValue, object? currentValue)
|
||||
=> TryParsePropertyValue(editorValue.Value);
|
||||
|
||||
private decimal? TryParsePropertyValue(object? value)
|
||||
private static decimal? TryParsePropertyValue(object? value)
|
||||
=> value is decimal decimalValue
|
||||
? decimalValue
|
||||
: decimal.TryParse(value?.ToString(), CultureInfo.InvariantCulture, out var parsedDecimalValue)
|
||||
@@ -108,7 +108,7 @@ public class DecimalPropertyEditor : DataEditor
|
||||
/// <summary>
|
||||
/// Validates the min/max configuration for the decimal property editor.
|
||||
/// </summary>
|
||||
internal class MinMaxValidator : DecimalPropertyConfigurationValidatorBase, IValueValidator
|
||||
internal sealed class MinMaxValidator : DecimalPropertyConfigurationValidatorBase, IValueValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MinMaxValidator"/> class.
|
||||
@@ -145,7 +145,7 @@ public class DecimalPropertyEditor : DataEditor
|
||||
/// <summary>
|
||||
/// Validates the step configuration for the decimal property editor.
|
||||
/// </summary>
|
||||
internal class StepValidator : DecimalPropertyConfigurationValidatorBase, IValueValidator
|
||||
internal sealed class StepValidator : DecimalPropertyConfigurationValidatorBase, IValueValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StepValidator"/> class.
|
||||
|
||||
@@ -39,7 +39,7 @@ public class IntegerPropertyEditor : DataEditor
|
||||
/// <summary>
|
||||
/// Defines the value editor for the integer property editor.
|
||||
/// </summary>
|
||||
internal class IntegerPropertyValueEditor : DataValueEditor
|
||||
internal sealed class IntegerPropertyValueEditor : DataValueEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IntegerPropertyValueEditor"/> class.
|
||||
@@ -106,7 +106,7 @@ public class IntegerPropertyEditor : DataEditor
|
||||
/// <summary>
|
||||
/// Validates the min/max configuration for the integer property editor.
|
||||
/// </summary>
|
||||
internal class MinMaxValidator : IntegerPropertyConfigurationValidatorBase, IValueValidator
|
||||
internal sealed class MinMaxValidator : IntegerPropertyConfigurationValidatorBase, IValueValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MinMaxValidator"/> class.
|
||||
@@ -143,7 +143,7 @@ public class IntegerPropertyEditor : DataEditor
|
||||
/// <summary>
|
||||
/// Validates the step configuration for the integer property editor.
|
||||
/// </summary>
|
||||
internal class StepValidator : IntegerPropertyConfigurationValidatorBase, IValueValidator
|
||||
internal sealed class StepValidator : IntegerPropertyConfigurationValidatorBase, IValueValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StepValidator"/> class.
|
||||
|
||||
@@ -37,7 +37,7 @@ public class LabelPropertyEditor : DataEditor
|
||||
new LabelConfigurationEditor(_ioHelper);
|
||||
|
||||
// provides the property value editor
|
||||
internal class LabelPropertyValueEditor : DataValueEditor
|
||||
internal sealed class LabelPropertyValueEditor : DataValueEditor
|
||||
{
|
||||
public LabelPropertyValueEditor(
|
||||
IShortStringHelper shortStringHelper,
|
||||
|
||||
@@ -2,13 +2,12 @@ using Umbraco.Cms.Core.IO;
|
||||
using Umbraco.Cms.Core.Models.Editors;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Core.PropertyEditors;
|
||||
|
||||
internal class MarkDownPropertyValueEditor : DataValueEditor
|
||||
internal sealed class MarkDownPropertyValueEditor : DataValueEditor
|
||||
{
|
||||
private readonly IMarkdownSanitizer _markdownSanitizer;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MemberGroupPickerPropertyEditor : DataEditor
|
||||
protected override IDataValueEditor CreateValueEditor() =>
|
||||
DataValueEditorFactory.Create<MemberGroupPickerPropertyValueEditor>(Attribute!);
|
||||
|
||||
private class MemberGroupPickerPropertyValueEditor : DataValueEditor
|
||||
private sealed class MemberGroupPickerPropertyValueEditor : DataValueEditor
|
||||
{
|
||||
private readonly IMemberGroupService _memberGroupService;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MemberPickerPropertyEditor : DataEditor
|
||||
protected override IDataValueEditor CreateValueEditor() =>
|
||||
DataValueEditorFactory.Create<MemberPickerPropertyValueEditor>(Attribute!);
|
||||
|
||||
private class MemberPickerPropertyValueEditor : DataValueEditor, IDataValueReference
|
||||
private sealed class MemberPickerPropertyValueEditor : DataValueEditor, IDataValueReference
|
||||
{
|
||||
private readonly IMemberService _memberService;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class TextOnlyValueEditor : DataValueEditor
|
||||
/// <summary>
|
||||
/// A common length validator for both textbox and text area.
|
||||
/// </summary>
|
||||
internal class LengthValidator : IValueValidator
|
||||
internal sealed class LengthValidator : IValueValidator
|
||||
{
|
||||
private readonly ILocalizedTextService _localizedTextService;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class UserPickerPropertyEditor : DataEditor
|
||||
protected override IDataValueEditor CreateValueEditor() =>
|
||||
DataValueEditorFactory.Create<UserPickerPropertyValueEditor>(Attribute!);
|
||||
|
||||
private class UserPickerPropertyValueEditor : DataValueEditor
|
||||
private sealed class UserPickerPropertyValueEditor : DataValueEditor
|
||||
{
|
||||
private readonly IUserService _userService;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Cms.Core.PropertyEditors.Validation;
|
||||
|
||||
internal class JsonPathValidationError
|
||||
internal sealed class JsonPathValidationError
|
||||
{
|
||||
public required string JsonPath { get; init; }
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ internal static class JsonPathValidator
|
||||
return errors;
|
||||
}
|
||||
|
||||
private class JsonPathValidationTreeItem
|
||||
private sealed class JsonPathValidationTreeItem
|
||||
{
|
||||
public required string JsonPath { get; init; }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Core.PublishedCache;
|
||||
|
||||
internal class PublishedElementPropertyBase : PublishedPropertyBase
|
||||
internal sealed class PublishedElementPropertyBase : PublishedPropertyBase
|
||||
{
|
||||
protected readonly IPublishedElement Element;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Services.AuthorizationStatus;
|
||||
|
||||
namespace Umbraco.Cms.Core.Security.Authorization;
|
||||
|
||||
internal class DictionaryPermissionAuthorizer : IDictionaryPermissionAuthorizer
|
||||
internal sealed class DictionaryPermissionAuthorizer : IDictionaryPermissionAuthorizer
|
||||
{
|
||||
private readonly IDictionaryPermissionService _dictionaryPermissionService;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Core.Services;
|
||||
/// <summary>
|
||||
/// Implements <see cref="IConsentService" />.
|
||||
/// </summary>
|
||||
internal class ConsentService : RepositoryService, IConsentService
|
||||
internal sealed class ConsentService : RepositoryService, IConsentService
|
||||
{
|
||||
private readonly IConsentRepository _consentRepository;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ using Umbraco.Extensions;
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace Umbraco.Cms.Core.Services;
|
||||
|
||||
internal class ContentVersionService : IContentVersionService
|
||||
internal sealed class ContentVersionService : IContentVersionService
|
||||
{
|
||||
private readonly IAuditRepository _auditRepository;
|
||||
private readonly IContentVersionCleanupPolicy _contentVersionCleanupPolicy;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class DocumentUrlService : IDocumentUrlService
|
||||
/// Model used to cache a single published document along with all it's URL segments.
|
||||
/// </summary>
|
||||
/// <remarks>Internal for the purpose of unit and benchmark testing.</remarks>
|
||||
internal class PublishedDocumentUrlSegments
|
||||
internal sealed class PublishedDocumentUrlSegments
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the document key.
|
||||
@@ -456,7 +456,7 @@ public class DocumentUrlService : IDocumentUrlService
|
||||
private static bool IsVariantAndPublishedForCulture(IContent document, string? culture) =>
|
||||
document.PublishCultureInfos?.Values.Any(x => x.Culture == culture) ?? false;
|
||||
|
||||
private IEnumerable<PublishedDocumentUrlSegment> ConvertToPersistedModel(PublishedDocumentUrlSegments model)
|
||||
private static IEnumerable<PublishedDocumentUrlSegment> ConvertToPersistedModel(PublishedDocumentUrlSegments model)
|
||||
{
|
||||
foreach (PublishedDocumentUrlSegments.UrlSegment urlSegment in model.UrlSegments)
|
||||
{
|
||||
@@ -816,7 +816,7 @@ public class DocumentUrlService : IDocumentUrlService
|
||||
return '/' + string.Join('/', urlSegments);
|
||||
}
|
||||
|
||||
private bool HideTopLevel(bool hideTopLevelNodeFromPath, bool isRootFirstItem, List<string> urlSegments)
|
||||
private static bool HideTopLevel(bool hideTopLevelNodeFromPath, bool isRootFirstItem, List<string> urlSegments)
|
||||
{
|
||||
if (hideTopLevelNodeFromPath is false)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Core.Services;
|
||||
/// <summary>
|
||||
/// Serializes entities to XML
|
||||
/// </summary>
|
||||
internal class EntityXmlSerializer : IEntityXmlSerializer
|
||||
internal sealed class EntityXmlSerializer : IEntityXmlSerializer
|
||||
{
|
||||
private readonly IConfigurationEditorJsonSerializer _configurationEditorJsonSerializer;
|
||||
private readonly IContentService _contentService;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services.OperationStatus;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services.FileSystem;
|
||||
|
||||
internal class PartialViewFolderService : FolderServiceOperationBase<IPartialViewRepository, PartialViewFolderModel, PartialViewFolderOperationStatus>, IPartialViewFolderService
|
||||
internal sealed class PartialViewFolderService : FolderServiceOperationBase<IPartialViewRepository, PartialViewFolderModel, PartialViewFolderOperationStatus>, IPartialViewFolderService
|
||||
{
|
||||
public PartialViewFolderService(IPartialViewRepository repository, ICoreScopeProvider scopeProvider)
|
||||
: base(repository, scopeProvider)
|
||||
|
||||
@@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services.OperationStatus;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services.FileSystem;
|
||||
|
||||
internal class ScriptFolderService : FolderServiceOperationBase<IScriptRepository, ScriptFolderModel, ScriptFolderOperationStatus>, IScriptFolderService
|
||||
internal sealed class ScriptFolderService : FolderServiceOperationBase<IScriptRepository, ScriptFolderModel, ScriptFolderOperationStatus>, IScriptFolderService
|
||||
{
|
||||
public ScriptFolderService(IScriptRepository repository, ICoreScopeProvider scopeProvider)
|
||||
: base(repository, scopeProvider)
|
||||
|
||||
@@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services.OperationStatus;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services.FileSystem;
|
||||
|
||||
internal class StylesheetFolderService : FolderServiceOperationBase<IStylesheetRepository, StylesheetFolderModel, StylesheetFolderOperationStatus>, IStylesheetFolderService
|
||||
internal sealed class StylesheetFolderService : FolderServiceOperationBase<IStylesheetRepository, StylesheetFolderModel, StylesheetFolderOperationStatus>, IStylesheetFolderService
|
||||
{
|
||||
public StylesheetFolderService(IStylesheetRepository repository, ICoreScopeProvider scopeProvider)
|
||||
: base(repository, scopeProvider)
|
||||
|
||||
@@ -418,7 +418,7 @@ public class IdKeyMap : IIdKeyMap, IDisposable
|
||||
|
||||
// ReSharper disable ClassNeverInstantiated.Local
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Local
|
||||
private class TypedIdDto
|
||||
private sealed class TypedIdDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Scoping;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services;
|
||||
|
||||
internal class KeyValueService : IKeyValueService
|
||||
internal sealed class KeyValueService : IKeyValueService
|
||||
{
|
||||
private readonly IKeyValueRepository _repository;
|
||||
private readonly ICoreScopeProvider _scopeProvider;
|
||||
|
||||
@@ -8,7 +8,7 @@ using Umbraco.Cms.Core.Services.OperationStatus;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services;
|
||||
|
||||
internal class MemberGroupService : RepositoryService, IMemberGroupService
|
||||
internal sealed class MemberGroupService : RepositoryService, IMemberGroupService
|
||||
{
|
||||
private readonly IMemberGroupRepository _memberGroupRepository;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using Umbraco.Cms.Core.Services.OperationStatus;
|
||||
namespace Umbraco.Cms.Core.Services;
|
||||
|
||||
/// <inheritdoc cref="Umbraco.Cms.Core.Services.IMemberTwoFactorLoginService" />
|
||||
internal class MemberTwoFactorLoginService : TwoFactorLoginServiceBase, IMemberTwoFactorLoginService
|
||||
internal sealed class MemberTwoFactorLoginService : TwoFactorLoginServiceBase, IMemberTwoFactorLoginService
|
||||
{
|
||||
private readonly IMemberService _memberService;
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@ public class NotificationService : INotificationService
|
||||
}
|
||||
}
|
||||
|
||||
private class NotificationRequest
|
||||
private sealed class NotificationRequest
|
||||
{
|
||||
public NotificationRequest(EmailMessage mail, string? action, string? userName, string? email)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using Umbraco.Cms.Core.Scoping;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services;
|
||||
|
||||
internal class RedirectUrlService : RepositoryService, IRedirectUrlService
|
||||
internal sealed class RedirectUrlService : RepositoryService, IRedirectUrlService
|
||||
{
|
||||
private readonly IRedirectUrlRepository _redirectUrlRepository;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using Umbraco.Cms.Core.Services.OperationStatus;
|
||||
namespace Umbraco.Cms.Core.Services;
|
||||
|
||||
/// <inheritdoc cref="Umbraco.Cms.Core.Services.IUserTwoFactorLoginService" />
|
||||
internal class UserTwoFactorLoginService : TwoFactorLoginServiceBase, IUserTwoFactorLoginService
|
||||
internal sealed class UserTwoFactorLoginService : TwoFactorLoginServiceBase, IUserTwoFactorLoginService
|
||||
{
|
||||
private readonly IUserService _userService;
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@ internal sealed class Diff
|
||||
/// <summary>
|
||||
/// Data on one input file being compared.
|
||||
/// </summary>
|
||||
internal class DiffData
|
||||
internal sealed class DiffData
|
||||
{
|
||||
/// <summary>Buffer of numbers that will be compared.</summary>
|
||||
internal int[] Data;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class SystemLock
|
||||
|
||||
// note - before making those classes some structs, read
|
||||
// about "impure methods" and mutating readonly structs...
|
||||
private class NamedSemaphoreReleaser : CriticalFinalizerObject, IDisposable
|
||||
private sealed class NamedSemaphoreReleaser : CriticalFinalizerObject, IDisposable
|
||||
{
|
||||
private readonly Semaphore? _semaphore;
|
||||
|
||||
@@ -156,7 +156,7 @@ public class SystemLock
|
||||
}
|
||||
}
|
||||
|
||||
private class SemaphoreSlimReleaser : IDisposable
|
||||
private sealed class SemaphoreSlimReleaser : IDisposable
|
||||
{
|
||||
private readonly SemaphoreSlim _semaphore;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using Umbraco.Cms.Core.Configuration.Models;
|
||||
namespace Umbraco.Cms.Core.Telemetry;
|
||||
|
||||
/// <inheritdoc />
|
||||
internal class SiteIdentifierService : ISiteIdentifierService
|
||||
internal sealed class SiteIdentifierService : ISiteIdentifierService
|
||||
{
|
||||
private readonly IConfigManipulator _configManipulator;
|
||||
private readonly ILogger<SiteIdentifierService> _logger;
|
||||
|
||||
@@ -11,7 +11,7 @@ using Umbraco.Extensions;
|
||||
namespace Umbraco.Cms.Core.Telemetry;
|
||||
|
||||
/// <inheritdoc />
|
||||
internal class TelemetryService : ITelemetryService
|
||||
internal sealed class TelemetryService : ITelemetryService
|
||||
{
|
||||
private readonly IPackagingService _packagingService;
|
||||
private readonly IMetricsConsentService _metricsConsentService;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Umbraco.Cms.Core;
|
||||
/// <remarks>
|
||||
/// Primarily this is used so that WebApi can auto-bind a string parameter to a UDI instance
|
||||
/// </remarks>
|
||||
internal class UdiTypeConverter : TypeConverter
|
||||
internal sealed class UdiTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ public class XmlNodeListFactory
|
||||
|
||||
#region XmlNodeListIterator
|
||||
|
||||
private class XmlNodeListIterator : XmlNodeList
|
||||
private sealed class XmlNodeListIterator : XmlNodeList
|
||||
{
|
||||
private readonly XPathNodeIterator? _iterator;
|
||||
private readonly IList<XmlNode> _nodes = new List<XmlNode>();
|
||||
@@ -108,7 +108,7 @@ public class XmlNodeListFactory
|
||||
|
||||
#region XmlNodeListEnumerator
|
||||
|
||||
private class XmlNodeListEnumerator : IEnumerator
|
||||
private sealed class XmlNodeListEnumerator : IEnumerator
|
||||
{
|
||||
private readonly XmlNodeListIterator _iterator;
|
||||
private int _position = -1;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class RecurringBackgroundJobHostedServiceRunner : IHostedService
|
||||
_logger.LogInformation("Completed stopping recurring background jobs hosted services");
|
||||
}
|
||||
|
||||
private class NamedServiceJob
|
||||
private sealed class NamedServiceJob
|
||||
{
|
||||
public NamedServiceJob(string name, IHostedService hostedService)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Umbraco.Cms.Core.Cache;
|
||||
/// keep as a whole in memory.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
internal class FullDataSetRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId>
|
||||
internal sealed class FullDataSetRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId>
|
||||
where TEntity : class, IEntity
|
||||
{
|
||||
protected static readonly TId[] EmptyIds = new TId[0]; // const
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Cms.Core.Cache;
|
||||
/// </para>
|
||||
/// <para>Used by DictionaryRepository.</para>
|
||||
/// </remarks>
|
||||
internal class SingleItemsOnlyRepositoryCachePolicy<TEntity, TId> : DefaultRepositoryCachePolicy<TEntity, TId>
|
||||
internal sealed class SingleItemsOnlyRepositoryCachePolicy<TEntity, TId> : DefaultRepositoryCachePolicy<TEntity, TId>
|
||||
where TEntity : class, IEntity
|
||||
{
|
||||
public SingleItemsOnlyRepositoryCachePolicy(IAppPolicyCache cache, IScopeAccessor scopeAccessor, RepositoryCachePolicyOptions options)
|
||||
|
||||
@@ -10,7 +10,7 @@ using Umbraco.Cms.Core.Configuration.Models;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Configuration;
|
||||
|
||||
internal class JsonConfigManipulator : IConfigManipulator
|
||||
internal sealed class JsonConfigManipulator : IConfigManipulator
|
||||
{
|
||||
private const string ConnectionStringObjectName = "ConnectionStrings";
|
||||
private const string UmbracoConnectionStringPath = $"{ConnectionStringObjectName}:{Constants.System.UmbracoConnectionName}";
|
||||
|
||||
@@ -136,7 +136,7 @@ internal sealed class DeliveryApiContentIndexHandleContentChanges : DeliveryApiC
|
||||
}
|
||||
});
|
||||
|
||||
private class CulturePublishStatus : IEquatable<CulturePublishStatus>
|
||||
private sealed class CulturePublishStatus : IEquatable<CulturePublishStatus>
|
||||
{
|
||||
public required string Culture { get; set; }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using Umbraco.Cms.Core.Scoping;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Examine;
|
||||
|
||||
internal class DeferredActions
|
||||
internal sealed class DeferredActions
|
||||
{
|
||||
// the default enlist priority is 100
|
||||
// enlist with a lower priority to ensure that anything "default" runs after us
|
||||
|
||||
@@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Runtime;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.Examine;
|
||||
|
||||
internal class ExamineIndexingMainDomHandler
|
||||
internal sealed class ExamineIndexingMainDomHandler
|
||||
{
|
||||
private readonly IMainDom _mainDom;
|
||||
private readonly IProfilingLogger _profilingLogger;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Umbraco.Cms.Infrastructure.Examine;
|
||||
/// <summary>
|
||||
/// Indexing handler for Examine indexes
|
||||
/// </summary>
|
||||
internal class ExamineUmbracoIndexingHandler : IUmbracoIndexingHandler
|
||||
internal sealed class ExamineUmbracoIndexingHandler : IUmbracoIndexingHandler
|
||||
{
|
||||
private readonly IBackgroundTaskQueue _backgroundTaskQueue;
|
||||
private readonly IContentValueSetBuilder _contentValueSetBuilder;
|
||||
@@ -208,7 +208,7 @@ internal class ExamineUmbracoIndexingHandler : IUmbracoIndexingHandler
|
||||
/// <summary>
|
||||
/// Re-indexes an <see cref="IContent" /> item on a background thread
|
||||
/// </summary>
|
||||
private class DeferredReIndexForContent : IDeferredAction
|
||||
private sealed class DeferredReIndexForContent : IDeferredAction
|
||||
{
|
||||
private readonly IBackgroundTaskQueue _backgroundTaskQueue;
|
||||
private readonly IContent _content;
|
||||
@@ -271,7 +271,7 @@ internal class ExamineUmbracoIndexingHandler : IUmbracoIndexingHandler
|
||||
/// <summary>
|
||||
/// Re-indexes an <see cref="IMedia" /> item on a background thread
|
||||
/// </summary>
|
||||
private class DeferredReIndexForMedia : IDeferredAction
|
||||
private sealed class DeferredReIndexForMedia : IDeferredAction
|
||||
{
|
||||
private readonly IBackgroundTaskQueue _backgroundTaskQueue;
|
||||
private readonly ExamineUmbracoIndexingHandler _examineUmbracoIndexingHandler;
|
||||
@@ -323,7 +323,7 @@ internal class ExamineUmbracoIndexingHandler : IUmbracoIndexingHandler
|
||||
/// <summary>
|
||||
/// Re-indexes an <see cref="IMember" /> item on a background thread
|
||||
/// </summary>
|
||||
private class DeferredReIndexForMember : IDeferredAction
|
||||
private sealed class DeferredReIndexForMember : IDeferredAction
|
||||
{
|
||||
private readonly IBackgroundTaskQueue _backgroundTaskQueue;
|
||||
private readonly ExamineUmbracoIndexingHandler _examineUmbracoIndexingHandler;
|
||||
@@ -366,7 +366,7 @@ internal class ExamineUmbracoIndexingHandler : IUmbracoIndexingHandler
|
||||
});
|
||||
}
|
||||
|
||||
private class DeferredDeleteIndex : IDeferredAction
|
||||
private sealed class DeferredDeleteIndex : IDeferredAction
|
||||
{
|
||||
private readonly ExamineUmbracoIndexingHandler _examineUmbracoIndexingHandler;
|
||||
private readonly int _id;
|
||||
@@ -435,7 +435,7 @@ internal class ExamineUmbracoIndexingHandler : IUmbracoIndexingHandler
|
||||
/// <summary>
|
||||
/// Removes all protected content from applicable indexes on a background thread
|
||||
/// </summary>
|
||||
private class DeferredRemoveProtectedContent : IDeferredAction
|
||||
private sealed class DeferredRemoveProtectedContent : IDeferredAction
|
||||
{
|
||||
private readonly IBackgroundTaskQueue _backgroundTaskQueue;
|
||||
private readonly ExamineUmbracoIndexingHandler _examineUmbracoIndexingHandler;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Logging.Serilog.Enrichers;
|
||||
/// This is used to create a new property in Logs called 'Log4NetLevel'
|
||||
/// So that we can map Serilog levels to Log4Net levels - so log files stay consistent
|
||||
/// </summary>
|
||||
internal class Log4NetLevelMapperEnricher : ILogEventEnricher
|
||||
internal sealed class Log4NetLevelMapperEnricher : ILogEventEnricher
|
||||
{
|
||||
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using Serilog.Events;
|
||||
|
||||
namespace Umbraco.Cms.Core.Logging.Viewer;
|
||||
|
||||
internal class CountingFilter : ILogFilter
|
||||
internal sealed class CountingFilter : ILogFilter
|
||||
{
|
||||
public CountingFilter() => Counts = new LogLevelCounts();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using Serilog.Events;
|
||||
|
||||
namespace Umbraco.Cms.Core.Logging.Viewer;
|
||||
|
||||
internal class ErrorCounterFilter : ILogFilter
|
||||
internal sealed class ErrorCounterFilter : ILogFilter
|
||||
{
|
||||
public int Count { get; private set; }
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using Umbraco.Extensions;
|
||||
namespace Umbraco.Cms.Core.Logging.Viewer;
|
||||
|
||||
// Log Expression Filters (pass in filter exp string)
|
||||
internal class ExpressionFilter : ILogFilter
|
||||
internal sealed class ExpressionFilter : ILogFilter
|
||||
{
|
||||
private const string ExpressionOperators = "()+=*<>%-";
|
||||
private readonly Func<LogEvent, bool>? _filter;
|
||||
@@ -57,7 +57,7 @@ internal class ExpressionFilter : ILogFilter
|
||||
|
||||
public bool TakeLogEvent(LogEvent e) => _filter == null || _filter(e);
|
||||
|
||||
private Func<LogEvent, bool>? PerformMessageLikeFilter(string filterExpression, SerilogLegacyNameResolver serilogLegacyNameResolver)
|
||||
private static Func<LogEvent, bool>? PerformMessageLikeFilter(string filterExpression, SerilogLegacyNameResolver serilogLegacyNameResolver)
|
||||
{
|
||||
var filterSearch = $"@Message like '%{SerilogExpression.EscapeLikeExpressionContent(filterExpression)}%'";
|
||||
if (SerilogExpression.TryCompile(filterSearch, null, serilogLegacyNameResolver, out CompiledExpression? compiled, out var error))
|
||||
|
||||
@@ -2,7 +2,7 @@ using Serilog.Events;
|
||||
|
||||
namespace Umbraco.Cms.Core.Logging.Viewer;
|
||||
|
||||
internal class MessageTemplateFilter : ILogFilter
|
||||
internal sealed class MessageTemplateFilter : ILogFilter
|
||||
{
|
||||
public readonly Dictionary<string, int> Counts = new();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ using ILogger = Serilog.ILogger;
|
||||
|
||||
namespace Umbraco.Cms.Core.Logging.Viewer;
|
||||
|
||||
internal class SerilogJsonLogViewer : SerilogLogViewerSourceBase
|
||||
internal sealed class SerilogJsonLogViewer : SerilogLogViewerSourceBase
|
||||
{
|
||||
private const int FileSizeCap = 100;
|
||||
private readonly ILogger<SerilogJsonLogViewer> _logger;
|
||||
@@ -112,7 +112,7 @@ internal class SerilogJsonLogViewer : SerilogLogViewerSourceBase
|
||||
return logs;
|
||||
}
|
||||
|
||||
private string GetSearchPattern(DateTime day) => $"*{day:yyyyMMdd}*.json";
|
||||
private static string GetSearchPattern(DateTime day) => $"*{day:yyyyMMdd}*.json";
|
||||
|
||||
private bool TryRead(LogEventReader reader, out LogEvent? evt)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install;
|
||||
/// <summary>
|
||||
/// Creates the initial database data during install.
|
||||
/// </summary>
|
||||
internal class DatabaseDataCreator
|
||||
internal sealed class DatabaseDataCreator
|
||||
{
|
||||
|
||||
internal const string EditorGroupAlias = "editor";
|
||||
|
||||
@@ -8,10 +8,9 @@ namespace Umbraco.Cms.Infrastructure.Migrations;
|
||||
/// <summary>
|
||||
/// Implements <see cref="IMigrationContext" />.
|
||||
/// </summary>
|
||||
internal class MigrationContext : IMigrationContext
|
||||
internal sealed class MigrationContext : IMigrationContext
|
||||
{
|
||||
private readonly Action? _onCompleteAction;
|
||||
private readonly List<Type> _postMigrations = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MigrationContext" /> class.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user