From b2b4f0e7e062dcd1b4f6e6a88b2c740d7d993082 Mon Sep 17 00:00:00 2001 From: devil_1nc Date: Tue, 22 Nov 2022 14:44:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE=D0=B2=20=D0=B2=20?= =?UTF-8?q?=D1=85=D1=80=D0=B0=D0=BD=D0=B8=D0=BB=D0=B8=D1=89=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Airbus/Airbus/FormMapWithSetPlanes.cs | 43 +++++++++++---------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/Airbus/Airbus/FormMapWithSetPlanes.cs b/Airbus/Airbus/FormMapWithSetPlanes.cs index bcc8bac..e372d50 100644 --- a/Airbus/Airbus/FormMapWithSetPlanes.cs +++ b/Airbus/Airbus/FormMapWithSetPlanes.cs @@ -98,38 +98,31 @@ namespace Airbus ReloadMaps(); } } + private void AddPlane(DrawningAirbus plane) + { + if (listBoxMaps.SelectedIndex == -1) + { + return; + } + if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + new DrawningObjectPlane(plane) != -1) + { + MessageBox.Show("Объект добавлен"); + pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + } + else + { + MessageBox.Show("Не удалось добавить объект"); + } + + } //добавление объекта private void ButtonAddPlane_Click(object sender, EventArgs e) { var formPlaneConfig = new FormPlaneConfig(); - //TODO Call method AvvEvent from formPlaneConfig - + formPlaneConfig.AddEvent(AddPlane); formPlaneConfig.Show(); - - ////////////// ЭТО - /*if(_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? String.Empty] == null)*/ - { - return; - } - - /*FormAirbus form = new(); - - if (form.ShowDialog() == DialogResult.OK) - { - DrawningObjectPlane plane = new(form.SelectedPlane);*/ - - /* if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? String.Empty] + plane != -1) - { - MessageBox.Show("Объект добавлен"); - pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? String.Empty].ShowSet(); - } - else - { - MessageBox.Show("Не удалось добавить объект"); - } - }*/ } //удаление объекта private void ButtonRemovePlane_Click(object sender, EventArgs e)