Changes: ButtonAddWarAirplane_Click StorageOverflowException
This commit is contained in:
parent
7c2ac102e0
commit
13465da48f
@ -103,17 +103,17 @@ namespace AirBomber
|
||||
form.Show();
|
||||
Action<DrawingWarAirplane>? warAirplaneDelegate = new((m) =>
|
||||
{
|
||||
bool q = obj + m;
|
||||
|
||||
if (q == true)
|
||||
try
|
||||
{
|
||||
bool q = obj + m;
|
||||
MessageBox.Show("Объект добавлен");
|
||||
_logger.LogInformation($"Добавлен объект в коллекцию {listBoxStorages.SelectedItem.ToString() ?? string.Empty}");
|
||||
pictureBoxCollection.Image = obj.ShowWarAirplane();
|
||||
}
|
||||
else
|
||||
catch (StorageOverflowException ex)
|
||||
{
|
||||
MessageBox.Show("Не удалось добавить объект");
|
||||
_logger.LogWarning($"Не удалось добавить объект");
|
||||
_logger.LogInformation($"Коллекция {listBoxStorages.SelectedItem.ToString() ?? string.Empty} переполнена");
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user