Исправил, готово

This commit is contained in:
Алексей Тихоненков 2023-10-30 16:39:38 +04:00
parent 7b693f5fd7
commit 10edf8895b
2 changed files with 6 additions and 6 deletions

View File

@ -106,7 +106,7 @@ namespace AntiAircraftGun
FormAntiAirCraftGun form = new(); FormAntiAirCraftGun form = new();
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
{ {
if (obj + form.SelectedZenit) if ((obj + form.SelectedZenit)==1)
{ {
MessageBox.Show("Объект добавлен"); MessageBox.Show("Объект добавлен");
pictureBoxCollection.Image = obj.ShowZenits(); pictureBoxCollection.Image = obj.ShowZenits();

View File

@ -38,18 +38,18 @@ namespace AntiAircraftGun.Generics
public int Insert(T car) public int Insert(T car)
{ {
if (_places.Count == _maxCount) if (_places.Count == _maxCount)
return false; return -1;
Insert(car, 0); Insert(car, 0);
return true; return 1;
} }
public bool Insert(T car, int position) public int Insert(T car, int position)
{ {
if (!(position >= 0 && position <= Count && _places.Count < _maxCount)) if (!(position >= 0 && position <= Count && _places.Count < _maxCount))
return false; return -1;
_places.Insert(position, car); _places.Insert(position, car);
return true; return 1;
} }
/// <summary> /// <summary>