| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using BlazorGeolocation;
- using cwebplusApp;
- using cwebplusApp.Shared;
- using cwebplusApp.Shared.Services;
- using FisSst.BlazorMaps.DependencyInjection;
- using MatBlazor;
- using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
- using Microsoft.Extensions.DependencyInjection;
- using System;
- using System.Collections.Generic;
- using System.Net.Http;
- using System.Threading.Tasks;
- using TG.Blazor.IndexedDB;
-
- namespace CaritasPWA {
- public class Program {
- public static async Task Main(string[] args) {
- var builder = WebAssemblyHostBuilder.CreateDefault(args);
- builder.RootComponents.Add<App>("app");
-
- builder.Services.AddMatBlazor();
- builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
- builder.Services.AddScoped<IBicycleRestService, BicycleRestService>();
- builder.Services.AddSingleton<AppState>();
- builder.Services.AddSingleton<PageHistoryManager>();
- builder.Services.AddSingleton<ReportDataProvider>();
- builder.Services.AddSingleton<OnlineStatusProvider>();
- builder.Services.AddSingleton<PermissionsProvider>();
- builder.Services.AddSingleton<ScrollLockRemover>();
- builder.Services.AddSingleton<InputCursorHandler>();
- builder.Services.AddScoped<ReportRepositoryService>();
- builder.Services.AddScoped<Toaster>();
- builder.Services.AddScoped<UserDataProvider>();
- builder.Services.AddScoped<MasterDataService>();
- builder.Services.AddScoped<BlazorGeolocationService>();
- builder.Services.AddLocalization();
- builder.Services.AddBlazorLeafletMaps();
-
- builder.Services.AddMatToaster(config => {
- config.Position = MatToastPosition.BottomCenter;
- config.PreventDuplicates = true;
- config.NewestOnTop = true;
- config.MaxDisplayedToasts = 5;
- config.ShowCloseButton = true;
- config.ShowProgressBar = true;
- config.MaximumOpacity = 100;
- config.VisibleStateDuration = 10000;
- config.ShowTransitionDuration = 300;
- config.HideTransitionDuration = 150;
- });
-
- builder.Services.AddIndexedDB(dbStore => {
- dbStore.DbName = "CwebPlusAppDB";
- dbStore.Version = 1;
-
- dbStore.Stores.Add(new StoreSchema {
- Name = "FoundReportRepositoryItems",
- PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true },
- Indexes = new List<IndexSpec> {
- new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false},
- new IndexSpec{Name="status", KeyPath = "status", Auto=false}
- }
- });
-
- dbStore.Stores.Add(new StoreSchema {
- Name = "MissingReportRepositoryItems",
- PrimaryKey = new IndexSpec { Name = "id", KeyPath = "id", Auto = true },
- Indexes = new List<IndexSpec> {
- new IndexSpec{Name="serverRefNbr", KeyPath = "serverRefNbr", Auto=false},
- new IndexSpec{Name="status", KeyPath = "status", Auto=false}
- }
- });
- });
-
- await builder.Build().RunAsync();
- }
- }
- }
|