исправлена кнопка Удалить набор
This commit is contained in:
parent
79f59d7743
commit
fc9c663a4e
@ -39,10 +39,23 @@ namespace AirplaneWithRadar
|
|||||||
ReloadObjects();
|
ReloadObjects();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private void listBoxStorages_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
pictureBoxCollection.Image = storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowAirplanes();
|
||||||
|
}
|
||||||
|
|
||||||
private void buttonDelObject_Click(object sender, EventArgs e)
|
private void buttonDelObject_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
pictureBoxCollection.Image = storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowAirplanes();
|
if (listBoxStorages.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (MessageBox.Show($"Удалить объект { listBoxStorages.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
storage.DelSet(listBoxStorages.SelectedItem.ToString() ?? string.Empty);
|
||||||
|
ReloadObjects();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private void ButtonAddAirplane_Click(object sender, EventArgs e)
|
private void ButtonAddAirplane_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -110,10 +123,5 @@ namespace AirplaneWithRadar
|
|||||||
}
|
}
|
||||||
pictureBoxCollection.Image = obj.ShowAirplanes();
|
pictureBoxCollection.Image = obj.ShowAirplanes();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void listBoxStorages_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
pictureBoxCollection.Image = storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowAirplanes();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user