From 2f8f9b8d1c1314aaa70a604725f056c2474b249b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=9A=D1=83=D0=B4=D1=80=D0=B8?= =?UTF-8?q?=D0=BD=D1=81=D0=BA=D0=B8=D0=B9?= Date: Mon, 20 May 2024 10:35:43 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=968?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectContainerShip/FormShipCollection.cs | 4 ++-- ProjectContainerShip/ProjectContainerShip/Program.cs | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ProjectContainerShip/ProjectContainerShip/FormShipCollection.cs b/ProjectContainerShip/ProjectContainerShip/FormShipCollection.cs index d48d167..69e65d7 100644 --- a/ProjectContainerShip/ProjectContainerShip/FormShipCollection.cs +++ b/ProjectContainerShip/ProjectContainerShip/FormShipCollection.cs @@ -78,8 +78,8 @@ public partial class FormShipCollection : Form _logger.LogInformation("Добавлен объект: " + ship.GetDataForSave()); } } - catch (ObjectNotFoundException) { } - catch (CollectionOverflowException ex) + catch (CollectionOverflowException) { } + catch (ObjectIsEqualException ex) { MessageBox.Show("Не удалось добавить объект"); _logger.LogError("Ошибка : {Messsage}", ex.Message); diff --git a/ProjectContainerShip/ProjectContainerShip/Program.cs b/ProjectContainerShip/ProjectContainerShip/Program.cs index e4d028b..33af658 100644 --- a/ProjectContainerShip/ProjectContainerShip/Program.cs +++ b/ProjectContainerShip/ProjectContainerShip/Program.cs @@ -21,12 +21,8 @@ namespace ProjectContainerShip ConfigureServices(services); using ServiceProvider serviceProvider = services.BuildServiceProvider(); Application.Run(serviceProvider.GetRequiredService()); - } - /// - /// Конфигурация сервиса DI - /// - /// + } private static void ConfigureServices(ServiceCollection services) { string[] path = Directory.GetCurrentDirectory().Split('\\');