исправление ошибок

This commit is contained in:
10Г Егор Романов 2022-11-06 12:54:35 +04:00
parent ebc44e92dc
commit 9ab984f93d
2 changed files with 26 additions and 0 deletions

View File

@ -89,6 +89,7 @@
this.listBoxMaps.Name = "listBoxMaps";
this.listBoxMaps.Size = new System.Drawing.Size(199, 104);
this.listBoxMaps.TabIndex = 4;
this.listBoxMaps.SelectedIndexChanged += new System.EventHandler(this.ListBoxMaps_SelectedIndexChanged);
//
// buttonAddMap
//
@ -113,6 +114,8 @@
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
//

View File

@ -59,6 +59,29 @@ 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<DrawingObjectHoistingCrane, AbstractMap>(
pictureBox.Width, pictureBox.Height, map);
}
else
{
_mapHoistingCraneCollectionGeneric = null;
}
}
/// <summary>
/// Добавление карты
/// </summary>