39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Database;
|
|
using System;
|
|
using Commentbase;
|
|
using Microsoft.VisualBasic;
|
|
|
|
namespace View
|
|
{
|
|
public static class Program
|
|
{
|
|
private static ServiceProvider? _serviceProvider;
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
|
[STAThread]
|
|
public static void Main()
|
|
{
|
|
ApplicationConfiguration.Initialize();
|
|
var services = new ServiceCollection();
|
|
ConfigureServices(services);
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
Application.Run(_serviceProvider.GetRequiredService<MainForm>());
|
|
}
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
{
|
|
services.AddTransient<Abstracts, Implements>();
|
|
services.AddTransient<MainForm>();
|
|
services.AddTransient<FormAlbum>();
|
|
services.AddTransient<FormAlbums>();
|
|
services.AddTransient<FormLocation>();
|
|
services.AddTransient<FormLocations>();
|
|
services.AddTransient<FormAuthor>();
|
|
services.AddTransient<FormAuthors>();
|
|
services.AddTransient<FormPhoto>();
|
|
services.AddTransient<FormPhotos>();
|
|
services.AddTransient<FormComment>();
|
|
services.AddTransient<FormComments>();
|
|
}
|
|
}
|
|
} |