diff --git a/AirplaneWithRadar/AirplaneWithRadar/AirplanesGenericStorage.cs b/AirplaneWithRadar/AirplaneWithRadar/AirplanesGenericStorage.cs index d061c7e..f4f4ddf 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/AirplanesGenericStorage.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/AirplanesGenericStorage.cs @@ -72,9 +72,8 @@ namespace AirplaneWithRadar.Generics /// Название набора public void DelSet(string name) { - if (!_airplaneStorages.ContainsKey(name)) - return; - _airplaneStorages.Remove(name); + if (_airplaneStorages.ContainsKey(name)) + _airplaneStorages.Remove(name); } /// /// Доступ к набору diff --git a/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneCollection.cs b/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneCollection.cs index 1bc0988..2ed9279 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneCollection.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneCollection.cs @@ -81,6 +81,7 @@ namespace AirplaneWithRadar MessageBoxButtons.OK, MessageBoxIcon.Error); } } + ReloadObjects(); } /// @@ -217,6 +218,7 @@ namespace AirplaneWithRadar if (obj - pos != null) { MessageBox.Show("Объект удален"); + _logger.LogInformation($"Удален объект с позиции {pos}"); pictureBoxCollection.Image = obj.ShowAirplanes(); } else