From 666c51d70b0dd53ff6f1965c97af59d05f467c61 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, 5 Dec 2022 01:32:59 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormMapWithSetHoistingCrane.Designer.cs | 1 - .../FormMapWithSetHoistingCrane.cs | 26 +------------------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs index 73f94b7..78ff45b 100644 --- a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs +++ b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.Designer.cs @@ -121,7 +121,6 @@ this.comboBoxSelectorMap.Name = "comboBoxSelectorMap"; this.comboBoxSelectorMap.Size = new System.Drawing.Size(200, 28); this.comboBoxSelectorMap.TabIndex = 0; - this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged); // // textBoxNewMapName // diff --git a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs index 1485f78..4580210 100644 --- a/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs +++ b/HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs @@ -29,7 +29,6 @@ namespace HoistingCrane /// private readonly MapsCollection _mapsCollection; /// - private MapWithSetHoistingCraneGeneric _mapHoistingCraneCollectionGeneric; public FormMapWithSetHoistingCrane(ILogger logger) { InitializeComponent(); @@ -63,29 +62,6 @@ namespace HoistingCrane listBoxMaps.SelectedIndex = index; } } - private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) - { - AbstractMap map = null; - switch (comboBoxSelectorMap.Text) - { - case "Простая карта": - map = new SimpleMap(); - break; - case "Вторая карта": - map = new SecondMap(); - break; - - } - if (map != null) - { - _mapHoistingCraneCollectionGeneric = new MapWithSetHoistingCraneGeneric( - pictureBox.Width, pictureBox.Height, map); - } - else - { - _mapHoistingCraneCollectionGeneric = null; - } - } /// /// Добавление карты /// @@ -245,7 +221,7 @@ namespace HoistingCrane enums = Direction.Right; break; } - pictureBox.Image = _mapHoistingCraneCollectionGeneric.MoveObject(enums); + pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].MoveObject(enums); } private void saveToolStripMenuItem_Click(object sender, EventArgs e) {