DepartmentProject/DepartmentPortal/DepartmentPortalDesctop/Program.cs

47 lines
1005 B
C#
Raw Normal View History

2022-03-18 22:55:48 +04:00
using CoreDatabase;
using System;
using System.Windows.Forms;
using ToolsModule.DependencyManagment;
using ToolsModule.Interfaces;
namespace DepartmentPortalDesctop
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
DependencyManager.Instance.RegisterType<ISecurityManager, SecurityManager>();
DependencyManager.InitDependency();
var securityManager = DependencyManager.Instance.Resolve<ISecurityManager>();
securityManager.CheckStartDataSource();
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
int counter = 3;
while (counter > 0)
{
var form = new FormEnter();
if (form.ShowDialog() == DialogResult.OK)
{
break;
}
counter--;
}
if (counter > 0)
{
if (securityManager.IsAuth)
{
Application.Run(new FormMain());
}
}
}
}
}