From 0600a77fc528fc2669ec7d53d310eccb77f9ea9b Mon Sep 17 00:00:00 2001 From: YourDax Date: Mon, 11 Dec 2023 20:10:12 +0400 Subject: [PATCH] Fix --- .../AntiAirCraftGun/FormAntiAirCraftGunCollection.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs b/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs index 697dead..7095110 100644 --- a/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs +++ b/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs @@ -129,6 +129,11 @@ namespace AntiAircraftGun Serilog.Log.Warning($"Коллекция {listBoxStorages.SelectedItem.ToString() ?? string.Empty} переполнена"); MessageBox.Show(ex.Message); } + catch (ArgumentException ex) + { + Serilog.Log.Warning($"Добавляемый объект уже существует в коллекции {listBoxStorages.SelectedItem.ToString() ?? string.Empty}"); + MessageBox.Show("Добавляемый объект уже сущесвует в коллекции"); + } }); form.AddEvent(zenitDelegate); }