2020-04-24 10:34:54 +08:00
|
|
|
|
using System;
|
2022-11-16 17:23:29 +08:00
|
|
|
|
using System.Globalization;
|
2020-04-24 10:34:54 +08:00
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using System.Threading.Tasks;
|
2022-05-29 17:44:27 +08:00
|
|
|
|
using Microsoft.AspNetCore.Components.Web;
|
2020-03-11 18:45:37 +08:00
|
|
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2019-12-04 16:46:08 +08:00
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
namespace AntDesign.Docs.Wasm
|
2019-12-04 16:46:08 +08:00
|
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
2020-02-15 18:22:51 +08:00
|
|
|
|
public static async Task Main(string[] args)
|
2019-12-04 16:46:08 +08:00
|
|
|
|
{
|
2022-11-16 17:23:29 +08:00
|
|
|
|
if (!CultureInfo.CurrentCulture.Name.IsIn("en-US", "zh-CN"))
|
|
|
|
|
{
|
|
|
|
|
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
|
|
|
|
|
CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 18:22:51 +08:00
|
|
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
2020-03-11 18:45:37 +08:00
|
|
|
|
builder.RootComponents.Add<App>("app");
|
2022-05-29 17:44:27 +08:00
|
|
|
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
2020-02-15 18:22:51 +08:00
|
|
|
|
|
2020-04-24 10:34:54 +08:00
|
|
|
|
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
builder.Services.AddAntDesignDocs();
|
2019-12-04 16:46:08 +08:00
|
|
|
|
|
2020-02-15 18:22:51 +08:00
|
|
|
|
await builder.Build().RunAsync();
|
|
|
|
|
}
|
2019-12-04 16:46:08 +08:00
|
|
|
|
}
|
2020-04-24 10:34:54 +08:00
|
|
|
|
}
|