mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-14 17:01:18 +08:00
d2e9c4b247
* feat(module: config-provider): support RTL * add rtl for each component * fix rtl for pagination * add rtl for overlay
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using System.Globalization;
|
|
using System.Text.Encodings.Web;
|
|
using AntDesign;
|
|
using AntDesign.JsInterop;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddAntDesign(this IServiceCollection services)
|
|
{
|
|
services.TryAddScoped<DomEventService>();
|
|
services.TryAddScoped(sp => new HtmlRenderService(new HtmlRenderer(sp, sp.GetRequiredService<ILoggerFactory>(),
|
|
s => HtmlEncoder.Default.Encode(s)))
|
|
);
|
|
|
|
services.TryAddSingleton<IComponentIdGenerator, GuidComponentIdGenerator>();
|
|
services.TryAddScoped<IconService>();
|
|
services.TryAddScoped<InteropService>();
|
|
services.TryAddScoped<NotificationService>();
|
|
services.TryAddScoped<MessageService>();
|
|
services.TryAddScoped<ModalService>();
|
|
services.TryAddScoped<DrawerService>();
|
|
services.TryAddScoped<ConfirmService>();
|
|
services.TryAddScoped<ImageService>();
|
|
services.TryAddScoped<ConfigService>();
|
|
|
|
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CurrentCulture;
|
|
|
|
return services;
|
|
}
|
|
}
|
|
}
|