From 08123fb4d58b80cdafd9fabcf5a52bb5217fe449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?10=D0=93=20=D0=95=D0=B3=D0=BE=D1=80=20=D0=A0=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Mon, 10 Oct 2022 19:53:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D1=80=D0=B5=D1=82=D1=8C=D1=8F=20=D0=BB?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HoistingCrane/FormMapWithSetHoistingCrane.cs | 10 +++++----- .../HoistingCrane/MapWithSetHoistingCraneGeneric.cs | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs index 1f0d713..8784862 100644 --- a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs +++ b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs @@ -49,14 +49,14 @@ namespace HoistingCrane { return; } - var formHoistingCraneConfig = new FormHoistingCraneConfig(); - formHoistingCraneConfig.AddEvent(AddHoistingCrane); - formHoistingCraneConfig.Show(); - } - private void AddHoistingCrane(DrawingHoistingCrane drawingHoistingCrane) + FormHoistingCrane form = new(); + if (form.ShowDialog() == DialogResult.OK) { + DrawingObjectHoistingCrane hoistingCrane = new(form.SelectedHoistingCrane); + if (_mapHoistingCraneCollectionGeneric + hoistingCrane == 1) { MessageBox.Show("Объект добавлен"); + pictureBox.Image = _mapHoistingCraneCollectionGeneric.ShowSet(); } else { diff --git a/HoistingCrane/HoistingCrane/MapWithSetHoistingCraneGeneric.cs b/HoistingCrane/HoistingCrane/MapWithSetHoistingCraneGeneric.cs index 6704aac..5ab5352 100644 --- a/HoistingCrane/HoistingCrane/MapWithSetHoistingCraneGeneric.cs +++ b/HoistingCrane/HoistingCrane/MapWithSetHoistingCraneGeneric.cs @@ -42,7 +42,7 @@ namespace HoistingCrane Bitmap bmp = new(_pictureWidth, _pictureWidth); Graphics gr = Graphics.FromImage(bmp); DrawBackground(gr); - DrawHoistingCranes(gr); + DrawBulldozers(gr); return bmp; } @@ -107,6 +107,7 @@ namespace HoistingCrane } } + private void DrawBulldozers(Graphics gr) { int heightEl = _pictureHeight / _placeSizeHeight; int widthEl = _pictureWidth / _placeSizeWidth;