Лабораторная работа №8

This commit is contained in:
Олег Кудринский 2024-05-20 10:35:43 +04:00
parent 3f1795c430
commit 2f8f9b8d1c
2 changed files with 3 additions and 7 deletions

View File

@ -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);

View File

@ -21,12 +21,8 @@ namespace ProjectContainerShip
ConfigureServices(services);
using ServiceProvider serviceProvider = services.BuildServiceProvider();
Application.Run(serviceProvider.GetRequiredService<FormShipCollection>());
}
/// <summary>
/// Конфигурация сервиса DI
/// </summary>
/// <param name="services"></param>
}
private static void ConfigureServices(ServiceCollection services)
{
string[] path = Directory.GetCurrentDirectory().Split('\\');