Реализация метода добавления объектов в хранилище.
This commit is contained in:
parent
b5f38d5a2a
commit
b2b4f0e7e0
@ -98,38 +98,31 @@ namespace Airbus
|
|||||||
ReloadMaps();
|
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)
|
private void ButtonAddPlane_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var formPlaneConfig = new FormPlaneConfig();
|
var formPlaneConfig = new FormPlaneConfig();
|
||||||
|
|
||||||
//TODO Call method AvvEvent from formPlaneConfig
|
formPlaneConfig.AddEvent(AddPlane);
|
||||||
|
|
||||||
formPlaneConfig.Show();
|
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)
|
private void ButtonRemovePlane_Click(object sender, EventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user