From 3e84bde81fa6da76ca0c47880047f1088476dc29 Mon Sep 17 00:00:00 2001 From: VictoriaPresnyakova Date: Mon, 5 Dec 2022 10:14:19 +0400 Subject: [PATCH] Full_7 --- Catamaran/FormMapWithSetBoats.cs | 2 +- Catamaran/SetBoatsGeneric.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Catamaran/FormMapWithSetBoats.cs b/Catamaran/FormMapWithSetBoats.cs index 44c7fcc..11ae762 100644 --- a/Catamaran/FormMapWithSetBoats.cs +++ b/Catamaran/FormMapWithSetBoats.cs @@ -309,9 +309,9 @@ namespace Catamaran try { _mapsCollection.LoadData(openFileDialog.FileName); - ReloadMaps(); MessageBox.Show("Открытие прошло успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + ReloadMaps(); _logger.LogInformation($"Загрузка данных"); } diff --git a/Catamaran/SetBoatsGeneric.cs b/Catamaran/SetBoatsGeneric.cs index 0091e98..4ebf8a9 100644 --- a/Catamaran/SetBoatsGeneric.cs +++ b/Catamaran/SetBoatsGeneric.cs @@ -39,12 +39,13 @@ namespace Catamaran /// public int Insert(T boat) { + for (int i = 0; i < _maxCount; i++) { if (i == Count) { - _places.Insert(i, boat); + _places.Insert(i,boat); return i; } }