big changes
This commit is contained in:
@@ -1,13 +1,80 @@
|
||||
namespace ZA.CoreService.ESBCertificateManager
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using ZA.CoreService.ESBCertificateManager.Configuration;
|
||||
using ZA.CoreService.ESBCertificateManager.Models;
|
||||
using ZA.CoreService.ESBCertificateManager.Services;
|
||||
using ZA.CoreService.ESBCertificateManager.Setup;
|
||||
|
||||
[STAThread]
|
||||
static void Main()
|
||||
namespace ZA.CoreService.ESBCertificateManager;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
[STAThread]
|
||||
private static void Main()
|
||||
{
|
||||
ApplicationConfiguration.Initialize();
|
||||
|
||||
try
|
||||
{
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
AppSettings settings =
|
||||
AppSettingsLoader.Load();
|
||||
|
||||
SonicSetupRepository repository =
|
||||
new(
|
||||
settings.Database.ConnectionString);
|
||||
|
||||
SetupCoordinator coordinator =
|
||||
new(
|
||||
settings,
|
||||
repository);
|
||||
|
||||
SetupCheckResult setupResult =
|
||||
coordinator
|
||||
.CheckAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (setupResult.IsReady)
|
||||
{
|
||||
using SetupWizardForm setupForm =
|
||||
new(coordinator);
|
||||
|
||||
DialogResult setupDialogResult =
|
||||
setupForm.ShowDialog();
|
||||
|
||||
if (setupDialogResult != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetupCheckResult finalCheck =
|
||||
coordinator
|
||||
.CheckAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
if (!finalCheck.IsReady)
|
||||
{
|
||||
MessageBox.Show(
|
||||
"Die Einrichtung ist noch nicht vollständig.",
|
||||
"Setup unvollständig",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Warning);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Application.Run(
|
||||
new Form1());
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show(
|
||||
exception.ToString(),
|
||||
"Anwendung konnte nicht gestartet werden",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user