Изменил(а) на 'HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs'

Signed-off-by: RomanovEgor <romanov17903@gmail.com>
This commit is contained in:
RomanovEgor 2022-12-25 10:42:46 +04:00 committed by 10Г Егор Романов
parent b673e852b5
commit 1a47187541

View File

@ -30,7 +30,10 @@ namespace HoistingCrane
break;
case "Вторая карта":
map = new SecondMap();
break;
break;
}
if (map != null)
{
@ -47,24 +50,26 @@ namespace HoistingCrane
{
if (_mapHoistingCraneCollectionGeneric == null)
{
return;
}
FormHoistingCrane form = new();
if (form.ShowDialog() == DialogResult.OK)
var formHoistingCraneConfig = new FormHoistingCraneConfig();
formHoistingCraneConfig.AddEvent(AddHoistingCrane);
formHoistingCraneConfig.Show();
}
private void AddHoistingCrane(DrawingHoistingCrane drawingHoistingCrane)
{
DrawingObjectHoistingCrane hoistingCrane = new DrawingObjectHoistingCrane(drawingHoistingCrane);
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + hoistingCrane != -1)
{
DrawingObjectHoistingCrane hoistingCrane = new(form.SelectedHoistingCrane);
if (_mapHoistingCraneCollectionGeneric + hoistingCrane == 1)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapHoistingCraneCollectionGeneric.ShowSet();
}
else
{
MessageBox.Show("Не удалось добавить объект");
}
MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
}
else
{
MessageBox.Show("Не удалось добавить объект");
}
}
}
}
}
private void ButtonRemoveHoistingCrane_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))