Renamed namespaces and related identifiers from EnvelopeGenerator.WebUI to EnvelopeGenerator.Server across the project. This change affects data models, services, controllers, and configuration files to ensure consistency with the new architecture. Updated @using directives in Razor components and other files to reflect the new namespace structure. Adjusted project references in EnvelopeGenerator.Server.csproj to point to the new EnvelopeGenerator.Server.Client project. Modified middleware and logging configurations to use the new EnvelopeGenerator.Server namespace, including changes in Program.cs and appsettings.json. Updated resource and file references to use the new EnvelopeGenerator.Server path, ensuring correct resource loading. Adjusted configuration options in Program.cs to use the new namespace for options classes, such as ApiOptions and PdfViewerOptions. Updated authentication scheme names and related constants to align with the new namespace structure. Revised comments and documentation to reflect the new namespace, ensuring clarity and consistency in the codebase.
56 lines
2.5 KiB
C#
56 lines
2.5 KiB
C#
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
using EnvelopeGenerator.Server.Client.Services;
|
|
using EnvelopeGenerator.Server.Client.Options;
|
|
using DevExpress.Blazor.Reporting;
|
|
using DevExpress.XtraReports.Web.Extensions;
|
|
using DevExpress.DataAccess.Web;
|
|
using DevExpress.XtraReports.Services;
|
|
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|
|
|
// HTTP Client (uses Server's YARP proxy)
|
|
builder.Services.AddScoped(sp => new HttpClient {
|
|
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
|
|
});
|
|
|
|
// Configuration Options
|
|
builder.Services.Configure<ApiOptions>(opts =>
|
|
builder.Configuration.GetSection(ApiOptions.SectionName).Bind(opts));
|
|
builder.Services.Configure<PdfViewerOptions>(opts =>
|
|
builder.Configuration.GetSection(PdfViewerOptions.SectionName).Bind(opts));
|
|
|
|
// Business Services
|
|
builder.Services.AddScoped<DocumentService>();
|
|
builder.Services.AddScoped<AuthService>();
|
|
builder.Services.AddScoped<AnnotationService>();
|
|
builder.Services.AddScoped<EnvelopeReceiverService>();
|
|
builder.Services.AddScoped<SignatureService>();
|
|
builder.Services.AddScoped<SignatureCacheService>();
|
|
builder.Services.AddSingleton<AppVersionService>();
|
|
|
|
// DevExpress WASM
|
|
builder.Services.AddDevExpressWebAssemblyBlazorPdfViewer();
|
|
builder.Services.AddDevExpressWebAssemblyBlazorReportViewer();
|
|
|
|
builder.Services.AddDevExpressBlazorReportingWebAssembly(configure => {
|
|
configure.UseDevelopmentMode();
|
|
});
|
|
|
|
// Reporting Services
|
|
builder.Services.AddScoped<IDataSourceWizardJsonConnectionStorage, CustomDataSourceWizardJsonDataConnectionStorage>();
|
|
builder.Services.AddScoped<IJsonDataConnectionProviderFactory, CustomJsonDataConnectionProviderFactory>();
|
|
builder.Services.AddScoped<IObjectDataSourceWizardTypeProvider, ObjectDataSourceWizardCustomTypeProvider>();
|
|
|
|
DevExpress.Utils.DeserializationSettings.RegisterTrustedClass(typeof(EnvelopeGenerator.Server.Client.Data.DataItemList));
|
|
DevExpress.Utils.DeserializationSettings.RegisterTrustedClass(typeof(EnvelopeGenerator.Server.Client.PredefinedReports.Report));
|
|
|
|
builder.Services.AddSingleton<InMemoryReportStorageWebExtension>();
|
|
builder.Services.AddSingleton<ReportStorageWebExtension>(sp => sp.GetRequiredService<InMemoryReportStorageWebExtension>());
|
|
builder.Services.AddScoped<IReportProviderAsync, CustomReportProvider>();
|
|
|
|
ReportStorageWebExtension.RegisterExtensionGlobal(new InMemoryReportStorageWebExtension());
|
|
|
|
var host = builder.Build();
|
|
await FontLoader.LoadFonts(host.Services.GetRequiredService<HttpClient>(), new List<string> { "opensans.ttf" });
|
|
await host.RunAsync();
|