PIbd-21 Belianin N.N. LabWork07 #7

Closed
Belnik wants to merge 5 commits from LabWork07 into LabWork06
2 changed files with 3 additions and 4 deletions
Showing only changes of commit 0630250103 - Show all commits

View File

@ -64,8 +64,7 @@ namespace Tank
_logger.LogInformation($"Добавлен набор: {SetTextBox.Text}");
}
private void ListBoxObjects_SelectedIndexChanged(object sender,
EventArgs e)
private void ListBoxObjects_SelectedIndexChanged(object sender, EventArgs e)
{
DrawTank.Image =
_storage[CollectionListBox.SelectedItem?.ToString() ?? string.Empty]?.ShowTanks();

View File

@ -34,10 +34,10 @@ namespace Tank
public bool Insert(T tank, int position)
{
if (position < 0 || position >= _maxCount)
throw new TankNotFoundException(position);
throw new TankNotFoundException(position); // По позиции
if (Count >= _maxCount)
throw new TankStorageOverflowException(_maxCount); // Макс количество или позицию
throw new TankStorageOverflowException(_maxCount); // Макс количество в коллекции
_places.Insert(0, tank);
return true;
}