итоговые правки лабы 8

This commit is contained in:
Полина Чубыкина 2023-12-23 18:06:12 +04:00
parent a049e091da
commit b5620899f0
2 changed files with 5 additions and 1 deletions

View File

@ -91,6 +91,10 @@ namespace Sailboat
MessageBox.Show(ex.Message); MessageBox.Show(ex.Message);
_logger.LogWarning($"{ex.Message} в наборе {listBoxStorages.SelectedItem.ToString()}"); _logger.LogWarning($"{ex.Message} в наборе {listBoxStorages.SelectedItem.ToString()}");
} }
catch (ArgumentException ex)
{
MessageBox.Show(ex.Message);
}
} }
private void buttonRemoveBoat_Click(object sender, EventArgs e) private void buttonRemoveBoat_Click(object sender, EventArgs e)

View File

@ -56,7 +56,7 @@ namespace Sailboat.Generics
throw new StorageOverflowException(_maxCount); throw new StorageOverflowException(_maxCount);
if (equal != null && _places.Contains(boat, equal)) if (equal != null && _places.Contains(boat, equal))
return false; throw new ArgumentException("Данный объект уже есть в коллекции");
_places.Insert(0, boat); _places.Insert(0, boat);
return true; return true;
} }