Реализация метода добавления объектов в хранилище.

This commit is contained in:
devil_1nc 2022-11-22 14:44:25 +04:00
parent b5f38d5a2a
commit b2b4f0e7e0

View File

@ -98,38 +98,31 @@ namespace Airbus
ReloadMaps();
}
}
private void AddPlane(DrawningAirbus plane)
{
if (listBoxMaps.SelectedIndex == -1)
{
return;
}
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + new DrawningObjectPlane(plane) != -1)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
}
else
{
MessageBox.Show("Не удалось добавить объект");
}
}
//добавление объекта
private void ButtonAddPlane_Click(object sender, EventArgs e)
{
var formPlaneConfig = new FormPlaneConfig();
//TODO Call method AvvEvent from formPlaneConfig
formPlaneConfig.AddEvent(AddPlane);
formPlaneConfig.Show();
////////////// ЭТО
/*if(_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? String.Empty] == null)*/
{
return;
}
/*FormAirbus form = new();
if (form.ShowDialog() == DialogResult.OK)
{
DrawningObjectPlane plane = new(form.SelectedPlane);*/
/* if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? String.Empty] + plane != -1)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? String.Empty].ShowSet();
}
else
{
MessageBox.Show("Не удалось добавить объект");
}
}*/
}
//удаление объекта
private void ButtonRemovePlane_Click(object sender, EventArgs e)