PIbd-21. Makarov D.V. Lab work 04 #4

Closed
DavidMakarov wants to merge 3 commits from lab4 into lab3
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 4f80893e3e - Show all commits

View File

@ -18,11 +18,13 @@ namespace AirplaneWithRadar.Generics
public void AddSet(string name)
{
if (airplaneStorages.ContainsKey(name)) { return; }
airplaneStorages.Add(name, new AirplanesGenericCollection<PaintAirplane, PaintObjectAirplane>(pictWidth, pictHeight));
}
public void DelSet(string name)
{
airplaneStorages.Remove(name);
if (airplaneStorages.ContainsKey(name))
airplaneStorages.Remove(name);
}
public AirplanesGenericCollection<PaintAirplane, PaintObjectAirplane>? this[string ind]
{

View File

@ -50,12 +50,11 @@ namespace AirplaneWithRadar
{
return;
}
if (MessageBox.Show($"Удалить объект { listBoxStorages.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
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)
{