Петрушин Егор ПИбд-22 Лабораторная работа №4 "Самоходная артиллерийская установка" #9

Closed
Egor_Petrushin wants to merge 5 commits from PIbd-22_Petrushin_E.A._Lab4 into PIbd-22_Petrushin_E.A._Lab3
2 changed files with 2 additions and 12 deletions
Showing only changes of commit f1924cb952 - Show all commits

View File

@ -78,8 +78,7 @@ namespace SelfPropelledArtilleryUnit
/// <param name="e"></param>
private void ListBoxObjects_SelectedIndexChanged(object sender, EventArgs e)
{
pictureBoxCollection.Image =
_storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowSPAUs();
pictureBoxCollection.Image = _storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowSPAUs();
}
private void ButtonDelObject_Click(object sender, EventArgs e)

View File

@ -61,20 +61,11 @@ namespace SelfPropelledArtilleryUnit.Generics
if (position >= _maxCount)
return -1;
int nullIndex = _places.IndexOf(null);
if (Count == 0)
{
_places.Add(spau);
}
else if (nullIndex != -1)
{
for (int i = nullIndex; i > 0; i--)
{
_places[i] = _places[i - 1];
}
_places[position] = spau;
}
else
{
_places.Insert(position, spau);
@ -91,7 +82,7 @@ namespace SelfPropelledArtilleryUnit.Generics
if (position < 0 || position >= Count)
return false;
_places[position] = null;
_places.RemoveAt(position);
return true;
}