PIbd-21 Belianin N.N. LabWork07 #7
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user