2023-01-21 16:55:51 +00:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2023-01-22 22:15:55 +00:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2023-01-21 16:55:51 +00:00
|
|
|
|
using Selector.MAUI.Data;
|
2023-01-22 22:15:55 +00:00
|
|
|
|
using Selector.MAUI.Services;
|
|
|
|
|
using Selector.SignalR;
|
2023-01-21 16:55:51 +00:00
|
|
|
|
|
|
|
|
|
namespace Selector.MAUI;
|
|
|
|
|
|
|
|
|
|
public static class MauiProgram
|
|
|
|
|
{
|
|
|
|
|
public static MauiApp CreateMauiApp()
|
|
|
|
|
{
|
|
|
|
|
var builder = MauiApp.CreateBuilder();
|
|
|
|
|
builder
|
|
|
|
|
.UseMauiApp<App>()
|
|
|
|
|
.ConfigureFonts(fonts =>
|
|
|
|
|
{
|
|
|
|
|
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
builder.Services.AddMauiBlazorWebView();
|
2023-01-22 22:15:55 +00:00
|
|
|
|
builder.Services.AddLogging(o =>
|
|
|
|
|
{
|
|
|
|
|
//o.AddConsole();
|
|
|
|
|
});
|
2023-01-21 16:55:51 +00:00
|
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
|
|
|
|
builder.Logging.AddDebug();
|
|
|
|
|
#endif
|
2023-01-22 22:15:55 +00:00
|
|
|
|
builder.Services.AddHttpClient();
|
2023-01-21 16:55:51 +00:00
|
|
|
|
|
2023-01-22 22:15:55 +00:00
|
|
|
|
builder.Services.AddTransient<ISelectorNetClient, SelectorNetClient>();
|
|
|
|
|
builder.Services.AddSingleton<SessionManager>();
|
|
|
|
|
|
|
|
|
|
builder.Services.AddSingleton<NowHubClient>();
|
|
|
|
|
builder.Services.AddSingleton<NowHubCache>();
|
2023-01-21 16:55:51 +00:00
|
|
|
|
|
|
|
|
|
return builder.Build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|