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;