Петрушин Егор ПИбд-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
3 changed files with 4 additions and 11 deletions
Showing only changes of commit 981cccdaa5 - Show all commits

View File

@ -89,8 +89,7 @@ namespace SelfPropelledArtilleryUnit
}
if (MessageBox.Show($"Удалить объект {listBoxStorages.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
_storage.DelSet(listBoxStorages.SelectedItem.ToString()
?? string.Empty);
_storage.DelSet(listBoxStorages.SelectedItem.ToString() ?? string.Empty);
ReloadObjects();
}
}
@ -139,8 +138,7 @@ namespace SelfPropelledArtilleryUnit
{
return;
}
var obj = _storage[listBoxStorages.SelectedItem.ToString() ??
string.Empty];
var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty];
if (obj == null)
{
return;

View File

@ -136,7 +136,7 @@ namespace SelfPropelledArtilleryUnit.Generics
for (int i = 0; i < _collection.Count; i++)
{
current = _collection[i];
current?.SetPosition(stringCount * 200, 280 - j * 100);
current?.SetPosition(stringCount * _placeSizeWidth, 280 - j * _placeSizeHeight);
stringCount++;
if (stringCount >= 3)
{

View File

@ -103,12 +103,7 @@ namespace SelfPropelledArtilleryUnit.Generics
{
if (position < 0 || position >= _maxCount)
return;
if(_places[position] == null)
{
_places[position] = value;
return;
}
_places.Insert(position, value);
_places[position] = value;
}
}
/// <summary>