From 10edf8895bab1a754a4b4c928aa00aaebad0a208 Mon Sep 17 00:00:00 2001 From: YourDax Date: Mon, 30 Oct 2023 16:39:38 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB,=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AntiAirCraftGun/FormAntiAirCraftGunCollection.cs | 2 +- AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs b/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs index 1aac3c3..61b285a 100644 --- a/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs +++ b/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs @@ -106,7 +106,7 @@ namespace AntiAircraftGun FormAntiAirCraftGun form = new(); if (form.ShowDialog() == DialogResult.OK) { - if (obj + form.SelectedZenit) + if ((obj + form.SelectedZenit)==1) { MessageBox.Show("Объект добавлен"); pictureBoxCollection.Image = obj.ShowZenits(); diff --git a/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs b/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs index a9e6890..e63218e 100644 --- a/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs +++ b/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs @@ -38,18 +38,18 @@ namespace AntiAircraftGun.Generics public int Insert(T car) { if (_places.Count == _maxCount) - return false; + return -1; 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)) - return false; + return -1; _places.Insert(position, car); - return true; + return 1; } ///