Изменил(а) на 'HoistingCrane/HoistingCrane/FormMapWithSetHoistingCrane.cs'
Signed-off-by: RomanovEgor <romanov17903@gmail.com>
This commit is contained in:
parent
8818b8e037
commit
4e2fbc8e7a
@ -31,6 +31,7 @@ namespace HoistingCrane
|
|||||||
case "Вторая карта":
|
case "Вторая карта":
|
||||||
map = new SecondMap();
|
map = new SecondMap();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (map != null)
|
if (map != null)
|
||||||
{
|
{
|
||||||
@ -49,22 +50,24 @@ namespace HoistingCrane
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FormHoistingCrane form = new();
|
var formHoistingCraneConfig = new FormHoistingCraneConfig();
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
formHoistingCraneConfig.AddEvent(AddHoistingCrane);
|
||||||
|
formHoistingCraneConfig.Show();
|
||||||
|
|
||||||
|
}
|
||||||
|
private void AddHoistingCrane(DrawingHoistingCrane drawingHoistingCrane)
|
||||||
{
|
{
|
||||||
DrawingObjectHoistingCrane hoistingCrane = new(form.SelectedHoistingCrane);
|
DrawingObjectHoistingCrane hoistingCrane = new DrawingObjectHoistingCrane(drawingHoistingCrane);
|
||||||
if (_mapHoistingCraneCollectionGeneric + hoistingCrane == 1)
|
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + hoistingCrane != -1)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект добавлен");
|
MessageBox.Show("Объект добавлен");
|
||||||
pictureBox.Image = _mapHoistingCraneCollectionGeneric.ShowSet();
|
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("Не удалось добавить объект");
|
MessageBox.Show("Не удалось добавить объект");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonRemoveHoistingCrane_Click(object sender, EventArgs e)
|
private void ButtonRemoveHoistingCrane_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))
|
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user