Доработка 5 лабы
This commit is contained in:
parent
4fe8d1ed15
commit
b741bbced7
@ -84,6 +84,22 @@ namespace WarmlyShip
|
||||
_mapShipCollectionGeneric = null;
|
||||
}
|
||||
}
|
||||
private void AddShip(DrawningShip ship)
|
||||
{
|
||||
if (ListBoxMaps.SelectedIndex == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_mapsCollection[ListBoxMaps.SelectedItem?.ToString() ?? string.Empty] + new DrawningObjectShip(ship) != -1)
|
||||
{
|
||||
MessageBox.Show("Объект добавлен");
|
||||
pictureBox.Image = _mapsCollection[ListBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Не удалось добавить объект");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Добавление объекта
|
||||
/// </summary>
|
||||
@ -92,7 +108,7 @@ namespace WarmlyShip
|
||||
private void ButtonAddShip_Click(object sender, EventArgs e)
|
||||
{
|
||||
var formShipConfig = new FormShipConfig();
|
||||
// TODO Call method AddEvent from formCarConfig
|
||||
formShipConfig.AddEvent(AddShip);
|
||||
formShipConfig.Show();
|
||||
}
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user