| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using ComputerSalesApp.Services;
- using ComputerSalesApp.UI;
- namespace ComputerSalesApp;
- internal static class Program
- {
- [STAThread]
- private static void Main()
- {
- Application.SetHighDpiMode(HighDpiMode.SystemAware);
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- try
- {
- bool restart;
- do
- {
- restart = false;
- using var loginForm = new LoginForm();
- if (loginForm.ShowDialog() != DialogResult.OK || loginForm.Session == null)
- {
- break;
- }
- using var mainForm = new MainForm(loginForm.Session);
- Application.Run(mainForm);
- restart = mainForm.LogoutRequested;
- }
- while (restart);
- }
- catch (Exception ex)
- {
- ErrorHandler.Show("Критическая ошибка", "Приложение не смогло продолжить работу.", ex);
- }
- }
- }
|